disc 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -22
  3. data/lib/disc/version.rb +1 -1
  4. data/lib/disc.rb +0 -13
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3ecc3356891d074ac864ebe024fdab7f8882d1e3
4
- data.tar.gz: 48318efa3c5ad39de7cf86e6fe632e73cc1cbcb0
3
+ metadata.gz: 6ffe5775ac38d2ed07abc9c602d02bece9ed62be
4
+ data.tar.gz: 3bb2ef3b149eedcfe99f15ea8b5a9c2a5bfcdc47
5
5
  SHA512:
6
- metadata.gz: 89f834da2af8da0a89f4a8d2eed744f0739b80c9f7d1ca2ae49c3a803815653affe16589c5708bfaf5314edd841d8327308ab0a7144ab4585f68fceb6228baaf
7
- data.tar.gz: 2afe64e1c088273a968db54d41531ca2ad9294f717d48ee743955c67d4f51b14ee3c431ede0e248aadfd5ad444bcd9485170de04a3a2c1faab81fa293e54e2d1
6
+ metadata.gz: d4d2f921456d0843e97101bda9a408db66ecd9bac51c961edddcfb05ca330a71d447354bf3fe9d805daa6ac65358aae51bd56d248edfd721cf0c541758bca8e7
7
+ data.tar.gz: a6ca018282b0c2d773424d823524e48814b67d67c1e7272baf8cedc6dbb70825fc0a6aed5bc6f2d8452516ee6e02476f102b0265987df176acc707857e0852fa
data/README.md CHANGED
@@ -83,30 +83,9 @@ end
83
83
  Dir["./jobs/**/*.rb"].each { |job| require job }
84
84
  ```
85
85
 
86
- ## Lifecycle Callbacks
87
-
88
- You can optionally define two methods on classes that include `Disc::Job` that
89
- will act as callbacks:
90
-
91
- ``` ruby
92
- def disc_start(job)
93
- end
94
-
95
- def disc_done(exception_or_nil)
96
- end
97
- ```
98
-
99
- Before the `perform` method is invoked, Disc will call `disc_start` and pass the
100
- job data as a Hash. After the job is finished, it will call `disc_done`.
101
-
102
- You could use these callbacks for things like aggregating metrics about the jobs
103
- (timing, number of times a certain job is run, etc), or for advanced logging,
104
- for example.
105
-
106
86
  ## Job Definition
107
87
 
108
- Both the error handler function and the `disc_start` callback get the data of
109
- the current job as a Hash, that has the following schema.
88
+ The error handler function gets the data of the current job as a Hash, that has the following schema.
110
89
 
111
90
  | | |
112
91
  |:-------------:|:------------------------------------------------------|
data/lib/disc/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Disc
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.12"
3
3
  end
data/lib/disc.rb CHANGED
@@ -72,17 +72,10 @@ class Disc
72
72
  job = MessagePack.unpack(serialized_job)
73
73
  job.update('id' => msgid, 'queue' => queue)
74
74
  instance = Object.const_get(job['class']).new
75
- instance.disc_start(job)
76
75
  instance.perform(*job['arguments'])
77
76
  disque.call('ACKJOB', msgid)
78
77
  rescue => err
79
78
  Disc.on_error(err, job)
80
- ensure
81
- begin
82
- instance.disc_done(err)
83
- rescue => boom
84
- Disc.on_error(boom, job)
85
- end
86
79
  end
87
80
  end
88
81
  end
@@ -98,12 +91,6 @@ class Disc
98
91
  base.extend(ClassMethods)
99
92
  end
100
93
 
101
- def disc_start(job)
102
- end
103
-
104
- def disc_done(error = nil)
105
- end
106
-
107
94
  module ClassMethods
108
95
  def disque
109
96
  defined?(@disque) ? @disque : Disc.disque
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: disc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - pote