tiny_bus 1.0.4 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tiny_bus.rb +8 -6
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 80e736518279f690809f359a1a1c4c96fd32154d3c847b83fe249e409bf5fd56
4
- data.tar.gz: a1557163fb8fb490e79cbf159411989de8fc0e49bb8b5436d43cd7392c554031
3
+ metadata.gz: 523256349438598095486d3bcdff8fc0df0c5c2375fef06402bd2385cbeb14e6
4
+ data.tar.gz: e832821fc355d7bf69a5378601bbc90c16439d683583b189d1f07be8481eccdf
5
5
  SHA512:
6
- metadata.gz: eb83e912761d438bc17d93a4121e0c897c3d88b212ec50a842d088cedcaa028b84b6e797727be10a817fe63ad93e941f0f82278ffc79bea5587d13e516398e0d
7
- data.tar.gz: bcf4adbfa6c0f959410b3b25ede768690c5e2c8bf47cd28e0d0b38e3d05941af44496656a9d75ce468da66d7e456a2761141413383bfba71b3c6759a38e61c88
6
+ metadata.gz: f7dc510d91314737850e511ab0e20b3c664ee8950766880a28b128f9b518fb0188acd0bd0c735ec7834c4c78650809f527352c42477fadaba1427f9c2714b127
7
+ data.tar.gz: fb351e69dacf513efc9198e67a3f6a5fd602f2d7924bcf7f1d3e5a9dfe62116892f360519d7863f6294b8aba65e56c9ee50796d7c6b7f9c5f68c4d8cf8494551
data/lib/tiny_bus.rb CHANGED
@@ -3,6 +3,8 @@ require 'set'
3
3
  require 'securerandom'
4
4
  require 'tiny_log'
5
5
 
6
+ # NOTE: This library depends on the TinyLog library.
7
+ #
6
8
  # This class implements a very simpler PubSub system where:
7
9
  # - subscribers can subscribe via the #sub method
8
10
  # - subscribers can unsubscribe via the #unsub method
@@ -25,11 +27,11 @@ require 'tiny_log'
25
27
  # TinyBus.new(raise_on_dead: true) # strict mode for undeliverable messages, defaults to false
26
28
  class TinyBus
27
29
  # log:
28
- # if specified it should be a valid filename
29
- # if not specified will default to $stdout
30
+ # if specified, it should be a TinyLog instance
31
+ # if not specified, it will create a new TinyLog instance for $stdout
30
32
  # dead:
31
- # if specified it should be a valid filename for dead letter logging
32
- # if not specified will default to $stderr
33
+ # if specified, it should be a TinyLog instance
34
+ # if not specified, it will create a new TinyLog instance for $stderr
33
35
  # raise_on_dead:
34
36
  # kind of a strict mode. if false, then messages with a topic with no
35
37
  # subscribers will go to the dead file. if true, then messages with a topic
@@ -37,8 +39,8 @@ class TinyBus
37
39
  def initialize(log: nil, dead: nil, raise_on_dead: false)
38
40
  @subs = {}
39
41
  @stats = { '.dead' => 0 }
40
- @log = log ? TinyLog.new(log) : TinyLog.new($stdout)
41
- @dead = dead ? TinyLog.new(dead) : TinyLog.new($stderr)
42
+ @log = log || TinyLog.new($stdout)
43
+ @dead = dead || TinyLog.new($stderr)
42
44
  @raise_on_dead = raise_on_dead
43
45
  end
44
46
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tiny_bus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Lunt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-18 00:00:00.000000000 Z
11
+ date: 2022-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tiny_log