yakc 0.1.3 → 1.0.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6394f9f59b13ff1861ecee11cf639d3622835d4b
4
- data.tar.gz: 0002f1f60d350f837a9b21075ffd7273a42badda
3
+ metadata.gz: f0f40899773656de9cfbead93243b26617837de3
4
+ data.tar.gz: da3d3e392bdf386f3ef68cea6cc216196c124787
5
5
  SHA512:
6
- metadata.gz: cb2d51f4c3acb8c744c4f2e99a5f336b4e396dfe35fcf07759b55c1366fd2764be798224d49e58cd46d85b4966a05a5e6252a6f0f7661701c99e97ff3e63f6d9
7
- data.tar.gz: 51e2823ee7974e0344fffea0043b712964b965d78b7e1fde657c922189fa5d81828b74f934ca20ed3ed0018d63b4465dc686588c25ca2dee09275b2fb9808770
6
+ metadata.gz: 281696b355fa78de003ca996b79689afd581d1e3180ac4ccfae43a13813b5fc2ac6957c006a123fca061d4b19e7550902df809dbaff5a8b35c70829a09623a8a
7
+ data.tar.gz: 96b984d65af7f148485adf11b7533a3914a22a0f8ced2624b6560263867b49f1b682f95b9656a691767d7731d0350eb02721c275260677dac1d061b6674d411c
data/README.md CHANGED
@@ -27,25 +27,17 @@ There are 2 main componets:
27
27
  This is the bit of code that handles what to do with the messages once they are received. There are 2 stages to this process:
28
28
 
29
29
  1. The message is parsed using *your* message parser(inherited from the `YAKC::Message` class) that does the parsing and validity checking.
30
- 2. The parsed message payload is broadcast to the system. You can specify your own publisher, but by default the handler will use [Yeller](http://www.github.com/gaorlov/yeller). It will broadcast the message with the key: "topic::event"
30
+ 2. The parsed message payload is broadcast using `ActiveSupport::Notifications`
31
+ 3: It will broadcast the message with the key: "topic::event"
31
32
 
32
33
  To set it up:
33
34
 
34
35
  ```ruby
35
- handler = YAKC::MessageBroadcaster.new publisher: MyBroadcaster, message_parser: MyMessageClass
36
- # or, if you are okay with Yeller
37
36
  handler = YAKC::MessageBroadcaster.new message_parser: MyMessageClass
38
37
  ```
39
38
 
40
39
  And now you're ready to init the [reader](#reader)
41
40
 
42
- #### Publisher Interface
43
-
44
- If you don't like Yeller, or want something that can talk cross-process, you can implement your own.
45
-
46
- The publisher interface is pretty simple: it has to implement
47
- * `broadcast( message, topic )` : This is the function that handles where the messages go.
48
-
49
41
  #### Message Interface
50
42
 
51
43
  The message parser needs to implement:
data/changelog.md ADDED
@@ -0,0 +1,9 @@
1
+ # Change log
2
+
3
+ ## v1.0.0
4
+
5
+ * moving from `Yeller` to `ActiveSupport::Notifications`
6
+
7
+ ## v0.1.3
8
+
9
+ * building out the basic gem
data/lib/yakc.rb CHANGED
@@ -1,7 +1,8 @@
1
1
  require "yakc/version"
2
2
  require 'active_support'
3
3
  require 'active_support/core_ext/module/delegation'
4
- require 'yeller'
4
+ require 'active_support/core_ext/object'
5
+ require 'active_support/notifications'
5
6
 
6
7
  module YAKC
7
8
  autoload :Configuration, 'yakc/configuration'
@@ -1,9 +1,8 @@
1
1
  module YAKC
2
2
  class MessageBroadcaster
3
- attr_accessor :publisher, :message_class, :instrumenter
3
+ attr_accessor :message_class, :instrumenter
4
4
 
5
- def initialize( publisher: Yeller, instrumenter: FallthroughInstrumenter, message_parser: )
6
- @publisher = publisher
5
+ def initialize( instrumenter: FallthroughInstrumenter, message_parser: )
7
6
  @message_class = message_parser
8
7
  @instrumenter = instrumenter.new
9
8
  raise "MessageBroadcaster must have a valid message class" unless @message_class
@@ -15,7 +14,7 @@ module YAKC
15
14
  @instrumenter.instrument( msg ) do
16
15
  if msg.broadcastable?
17
16
  # broadcast the specific topic event
18
- @publisher.broadcast msg.payload, broadcast_key( topic, msg.event )
17
+ ActiveSupport::Notifications.instrument broadcast_key( topic, msg.event ), message: msg.payload
19
18
  end
20
19
  end
21
20
  end
data/lib/yakc/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Yakc
2
- VERSION = "0.1.3"
2
+ VERSION = "1.0.0"
3
3
  end
data/yakc.gemspec CHANGED
@@ -18,7 +18,6 @@ Gem::Specification.new do |spec|
18
18
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency "yeller"
22
21
  spec.add_dependency "poseidon_cluster", "0.3.2.avvo3"
23
22
  spec.add_dependency "activesupport"
24
23
 
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yakc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-14 00:00:00.000000000 Z
11
+ date: 2017-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: yeller
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: poseidon_cluster
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -123,6 +109,7 @@ files:
123
109
  - Rakefile
124
110
  - bin/console
125
111
  - bin/setup
112
+ - changelog.md
126
113
  - lib/yakc.rb
127
114
  - lib/yakc/configuration.rb
128
115
  - lib/yakc/fallthrough_instrumenter.rb