postjob 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +24 -3
- data/lib/postjob/job.rb +2 -1
- data/lib/postjob/runner.rb +3 -0
- data/spec/spec_helper.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c176d6457b3172ff1442166970581a23ad20e34d
|
4
|
+
data.tar.gz: 05dfff87b04b642e69b825673e1142ca564dd0f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72b0de9d89df11900f08cd73b341fcf11e668eed95a32cd0853f8bef973311fd03ad7c26c13e1d1171286478326c705c7d4c4b65368044f1eb505c1d686b91b2
|
7
|
+
data.tar.gz: 596170acec013392c8ad2b74ab3ae5dc44f232bd36f731015c14cfa76db4563db0306f3e198cd0b9b321b27562d4837aafae0c5647bc18f9a081b88a7e0018ee
|
data/README.md
CHANGED
@@ -8,6 +8,23 @@ The `postjob` gem implements a simple way to have restartable, asynchronous, and
|
|
8
8
|
|
9
9
|
To install gem run `gem install postjob` or add `gem postjob` to your Gemfile and bundle.
|
10
10
|
|
11
|
+
## stable vs master
|
12
|
+
|
13
|
+
Postjob development generally happens in a master branch. "stable" versions are maintained in a stable branch.
|
14
|
+
|
15
|
+
Current stable version: 0.2.0
|
16
|
+
Currently released master version: 0.3.0
|
17
|
+
|
18
|
+
### Pre 1.0 versioning policy
|
19
|
+
|
20
|
+
Until release of version 1.0 we'll maintain "stable" versions with even minor version
|
21
|
+
numbers (e.g. "0.2"), and "unstable" in uneven minor versions (e.g. 0.3).
|
22
|
+
|
23
|
+
Stable versions are in production use; unstable versions are released for various
|
24
|
+
tests and experiments.
|
25
|
+
|
26
|
+
With version 1.0 we'll switch to semantic versioning.
|
27
|
+
|
11
28
|
## Development setup
|
12
29
|
|
13
30
|
1. Make sure you have PostgreSQL >= 9.5 installed
|
@@ -16,7 +33,7 @@ To install gem run `gem install postjob` or add `gem postjob` to your Gemfile an
|
|
16
33
|
|
17
34
|
To install this gem onto your local machine, run `bundle exec rake install`.
|
18
35
|
|
19
|
-
##
|
36
|
+
## Tests
|
20
37
|
|
21
38
|
Tests are set up to run twice, once against an ActiveRecord adapter, and once against a Simple::SQL provided adapter. To run the full test suite run
|
22
39
|
|
@@ -28,8 +45,12 @@ To run a single set of tests - this is usually fine during development - run
|
|
28
45
|
|
29
46
|
## Release gem
|
30
47
|
|
31
|
-
To release a new version of this gem , run
|
32
|
-
push git commits and tags, and push the `.gem` file
|
48
|
+
To release a new version of this gem , run `rake release`, which will bump the version number,
|
49
|
+
create a git tag for the version, push git commits and tags, and push the `.gem` file
|
50
|
+
to [rubygems.org](https://rubygems.org).
|
51
|
+
|
52
|
+
To release a new stable version of this gem , run `[VERSION=0.4.3] rake release:stable`, which
|
53
|
+
does the same, but based on the stable branch.
|
33
54
|
|
34
55
|
## Contributing
|
35
56
|
|
data/lib/postjob/job.rb
CHANGED
@@ -39,7 +39,7 @@ class Postjob::Job < Hash
|
|
39
39
|
attribute :timed_out
|
40
40
|
attribute :tags
|
41
41
|
|
42
|
-
STATUSES = %w(ok ready sleep err failed timeout)
|
42
|
+
STATUSES = %w(ok ready processing sleep err failed timeout)
|
43
43
|
|
44
44
|
def resolve
|
45
45
|
expect! status => STATUSES
|
@@ -47,6 +47,7 @@ class Postjob::Job < Hash
|
|
47
47
|
case status
|
48
48
|
when "ok" then result
|
49
49
|
when "ready" then :pending
|
50
|
+
when "processing" then :pending
|
50
51
|
when "sleep" then :pending
|
51
52
|
when "timeout" then raise Timeout::Error
|
52
53
|
when "err" then :pending
|
data/lib/postjob/runner.rb
CHANGED
@@ -41,6 +41,9 @@ module Postjob::Runner
|
|
41
41
|
when :manual then workflow = "__manual__"
|
42
42
|
when Symbol then workflow = "#{current_job.workflow}.#{workflow}"
|
43
43
|
when Module then workflow = workflow.name
|
44
|
+
when String then :nop
|
45
|
+
else
|
46
|
+
raise ArgumentError, "Unsupported workflow spec #{workflow.inspect}. Did you run await(fun(a, b)) instead of await(:fun, a, b)"
|
44
47
|
end
|
45
48
|
|
46
49
|
::Postjob::Queue.find_or_create_childjob(self.current_job, workflow, args,
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: postjob
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- radiospiel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|