stomp_actors 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -17,3 +17,4 @@ test/version_tmp
17
17
  tmp
18
18
  log/*
19
19
  tmp/*
20
+ .rvmrc
@@ -7,6 +7,8 @@ module StompActors
7
7
 
8
8
  attr_accessor :subscription_id
9
9
 
10
+ finalizer :cleanup
11
+
10
12
  def initialize
11
13
  async.start
12
14
  end
@@ -32,7 +34,7 @@ module StompActors
32
34
  client.ack(msg)
33
35
  end
34
36
 
35
- def finalize
37
+ def cleanup
36
38
  unsubscribe
37
39
  disconnect
38
40
  end
@@ -5,6 +5,8 @@ module StompActors
5
5
 
6
6
  include Client
7
7
 
8
+ finalizer :disconnect
9
+
8
10
  def initialize
9
11
  async.connect
10
12
  end
@@ -13,9 +15,6 @@ module StompActors
13
15
  client.send(queue, msg)
14
16
  end
15
17
 
16
- def finalize
17
- disconnect
18
- end
19
18
  end
20
19
  end
21
20
 
@@ -1,3 +1,3 @@
1
1
  module StompActors
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -43,9 +43,12 @@ describe StompActors::Consumer do
43
43
  sleep 0.1
44
44
  end
45
45
 
46
- it "should unsubscribe on finalize" do
46
+ it "should disconnect on termination" do
47
47
  consumer = MyConsumer.new(host, port, queue)
48
+ client = consumer.client
48
49
  sleep 0.1
49
- consumer.finalize
50
+ consumer.terminate
51
+ sleep 0.1
52
+ expect(client.connected?).to be_false
50
53
  end
51
54
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stomp_actors
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-10 00:00:00.000000000 Z
12
+ date: 2013-05-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler