active_pubsub 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -0
- data/active_pubsub.gemspec +1 -1
- data/lib/active_pubsub/publish_with_serializer.rb +23 -0
- data/lib/active_pubsub/publishable.rb +1 -1
- data/lib/active_pubsub/version.rb +1 -1
- data/lib/active_pubsub.rb +1 -0
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da7f9a48586c7b132198b137c527f7687f5231cf
|
4
|
+
data.tar.gz: 8af37fe38090cf6b7359ce55241b87b057e20764
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6a26480849a0cb7452bfeda855d2f25fbbdedb25f7fce8336111b3dc1b0cece05bd8c0078a2df8b609ba21b365e339501b6ca7cb1642d77571fd2cbea7c58dd
|
7
|
+
data.tar.gz: c451742d2d6e8043b073fafb2ac287b8e1982e16b9c1212eee36f0a862b8a864544eed0cb29d3ae3926fed6a7ac88ecd716a4cfd9796fa627a02bb798925249e
|
data/README.md
CHANGED
@@ -98,6 +98,24 @@ Average processed (subscriber) messages/second: 100-150
|
|
98
98
|
|
99
99
|
The throughput seems to be limited by the publisher mostly, from the very limited benchmarks thus far.
|
100
100
|
|
101
|
+
### Connecting to rabbit
|
102
|
+
|
103
|
+
If you are running rabbit at different address or port, set address via ENV variable, i.e.
|
104
|
+
|
105
|
+
```
|
106
|
+
RABBITMQ_URL=amqp://guest:guest@x.x.x.x:XXXX bundle exec subscriber start
|
107
|
+
```
|
108
|
+
|
109
|
+
Or you can set via config
|
110
|
+
|
111
|
+
``` ruby
|
112
|
+
::ActivePubsub.configure do |config|
|
113
|
+
config.address = "amqp://guest:guest@x.x.x.x:XXXX"
|
114
|
+
end
|
115
|
+
```
|
116
|
+
|
117
|
+
Its still really early in development cycle, so there may be issues running tests if you aren't running rabbit. Should probably fix that.
|
118
|
+
|
101
119
|
### Installation
|
102
120
|
|
103
121
|
Add this line to your application's Gemfile:
|
data/active_pubsub.gemspec
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
module ActivePubsub
|
2
|
+
module PublishWithSerializer
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
|
5
|
+
#todo: move this into separate gem
|
6
|
+
|
7
|
+
included do
|
8
|
+
class_attribute :publish_serializer
|
9
|
+
end
|
10
|
+
|
11
|
+
def serialized_resource
|
12
|
+
serialized_resource_attributes = self.class.publish_serializer.new(self).attributes
|
13
|
+
serialized_resource_attributes.merge!("changes" => changes) if self.changed?
|
14
|
+
::Marshal.dump(serialized_resource_attributes)
|
15
|
+
end
|
16
|
+
|
17
|
+
module ClassMethods
|
18
|
+
def serialize_publish_with(klass)
|
19
|
+
self.publish_serializer = klass
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/active_pubsub.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_pubsub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Ayre
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_attr
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: celluloid
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0
|
33
|
+
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: json
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -300,6 +300,7 @@ files:
|
|
300
300
|
- lib/active_pubsub/config.rb
|
301
301
|
- lib/active_pubsub/connection.rb
|
302
302
|
- lib/active_pubsub/event.rb
|
303
|
+
- lib/active_pubsub/publish_with_serializer.rb
|
303
304
|
- lib/active_pubsub/publishable.rb
|
304
305
|
- lib/active_pubsub/publisher.rb
|
305
306
|
- lib/active_pubsub/railtie.rb
|