concussion 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +20 -2
- data/concussion.gemspec +4 -5
- data/lib/concussion/version.rb +1 -1
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5dcee895a934fdd211c1551eea02e8ac99821435
|
4
|
+
data.tar.gz: 187252ec3bb52796a4c8958b417927bc2212811e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0e040b6a103cb17ebc3061abf433c301c88d5a85b0e0a2943569dc98ab76294f05fdb189b6c40672fbacab34c3a4ab87818e0a153dadf45d1e6a407c9910958
|
7
|
+
data.tar.gz: 6624cc4dadcc4dce777658d731916b8f555eeeb48f11dca834435b5ffe484d7ba2fe6165f7863f0d6eba797f112d22539ea2fb8c3a4dc7a34fa54ff48d3bdce8
|
data/README.md
CHANGED
@@ -39,7 +39,7 @@ Or install it yourself as:
|
|
39
39
|
Concussion won't do much on its own. It needs to connect to a persistent storage, and for that it needs an adapter. For
|
40
40
|
now it comes bundled with a Redis adapter, but that will be extracted into its own gem in due course.
|
41
41
|
|
42
|
-
The adapter is a class with a simple interface, described in the redis
|
42
|
+
The adapter is a class with a simple interface, described in the redis adapter class comments.
|
43
43
|
|
44
44
|
To use Concussion in a Rails project, add an initializer containing something along the lines of the following code:
|
45
45
|
|
@@ -53,10 +53,28 @@ Rails.application.config.after_initialize do
|
|
53
53
|
end
|
54
54
|
```
|
55
55
|
|
56
|
-
|
56
|
+
Any jobs which are set to run while the server is offline will run immediately on the initializer being run. For
|
57
57
|
this reason the initializer must be wrapped in an 'after_initialize' block to ensure all other components of the
|
58
58
|
application are ready for use.
|
59
59
|
|
60
|
+
You can use the namespace to target a particular server. If you have a two server set-up, for example, the following
|
61
|
+
initializer will ensure that jobs are only run by the server that created them:
|
62
|
+
|
63
|
+
```ruby
|
64
|
+
require "socket"
|
65
|
+
|
66
|
+
Rails.application.config.after_initialize do
|
67
|
+
|
68
|
+
namespace = "concussion-#{Socket.gethostname}"
|
69
|
+
redis = Redis.new(:host => "localhost", :port => 6379)
|
70
|
+
Concussion.store = Concussion::RedisAdapter.new(redis: redis, namespace: namespace)
|
71
|
+
Concussion.init
|
72
|
+
end
|
73
|
+
```
|
74
|
+
|
75
|
+
By adding the host name to the namespace, jobs are linked to the particular server.
|
76
|
+
|
77
|
+
|
60
78
|
When defining a job, use the following form:
|
61
79
|
|
62
80
|
```ruby
|
data/concussion.gemspec
CHANGED
@@ -12,11 +12,10 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.summary = %q{An addition to the Suckerpunch gem to allow delayed jobs that survive a server reset.}
|
13
13
|
spec.description = %q{Sucker Punch is an awesome gem which allows background tasks to be run from the current
|
14
14
|
process. They can be set to run in the future, but they will disappear and not get run if the
|
15
|
-
server or process running the jobs is stopped or restarted. Concussion
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
appropriate time.}
|
15
|
+
server or process running the jobs is stopped or restarted. Concussion provides a thin wrapper
|
16
|
+
around Suckerpunch job objects, persisting them to an external storage system of your choice.
|
17
|
+
When the server is restarted, any unprocessed jobs will be run immediately while future jobs
|
18
|
+
will be reinstated to be run at the appropriate time.}
|
20
19
|
spec.homepage = "https://github.com/chemica/concussion"
|
21
20
|
spec.license = "MIT"
|
22
21
|
|
data/lib/concussion/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: concussion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Randles-Dunkley
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sucker_punch
|
@@ -69,11 +69,10 @@ dependencies:
|
|
69
69
|
description: |-
|
70
70
|
Sucker Punch is an awesome gem which allows background tasks to be run from the current
|
71
71
|
process. They can be set to run in the future, but they will disappear and not get run if the
|
72
|
-
server or process running the jobs is stopped or restarted. Concussion
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
appropriate time.
|
72
|
+
server or process running the jobs is stopped or restarted. Concussion provides a thin wrapper
|
73
|
+
around Suckerpunch job objects, persisting them to an external storage system of your choice.
|
74
|
+
When the server is restarted, any unprocessed jobs will be run immediately while future jobs
|
75
|
+
will be reinstated to be run at the appropriate time.
|
77
76
|
email:
|
78
77
|
- ben@chemica.co.uk
|
79
78
|
executables: []
|