stompy 0.0.1

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.
@@ -0,0 +1,71 @@
1
+ stompy
2
+ ======
3
+
4
+ Stompy is a ruby client for the STOMP protocol. Since it uses non-blocking
5
+ IO it does not depend on eventmachine or require and additional thread.
6
+
7
+ [ ![Build status - Travis-ci](https://secure.travis-ci.org/paulasmuth/stompy.png) ](http://travis-ci.org/paulasmuth/stompy)
8
+
9
+
10
+ Usage
11
+ -----
12
+
13
+ ```ruby
14
+ require "rubygems"
15
+ require "stompy"
16
+
17
+ client = Stompy.new(
18
+ :host => "localhost",
19
+ :port => 61613,
20
+ :username => "admin"
21
+ :password => "password")
22
+
23
+
24
+ # subscribe to "my_channel"
25
+ client.subscribe("my_channel")
26
+
27
+ # next_message blocks until the next message is available
28
+ while msg = client.next_message
29
+ # print the received message
30
+ puts msg.headers.inspect
31
+ puts msg.body.inspect
32
+
33
+ # publish "OK" to some_channel with my_header=123
34
+ client.publish("some_channel", "OK",
35
+ :my_header => "123")
36
+ end
37
+ ```
38
+
39
+ timeouts...
40
+
41
+ Installation
42
+ ------------
43
+
44
+ gem install stompy
45
+
46
+ or in your Gemfile:
47
+
48
+ gem 'stompy', '>= 0.1'
49
+
50
+
51
+
52
+ License
53
+ -------
54
+
55
+ Copyright (c) 2011 Paul Asmuth
56
+
57
+ Permission is hereby granted, free of charge, to any person obtaining
58
+ a copy of this software and associated documentation files (the
59
+ "Software"), to use, copy and modify copies of the Software, subject
60
+ to the following conditions:
61
+
62
+ The above copyright notice and this permission notice shall be
63
+ included in all copies or substantial portions of the Software.
64
+
65
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
66
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
67
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
68
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
69
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
70
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
71
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1 @@
1
+ require "stompy/base"
@@ -0,0 +1,13 @@
1
+ class Stompy
2
+
3
+ # timeout after which a connection is considered down. the
4
+ # default is 500ms
5
+ DEFAULT_READ_TIMEOUT = 0.5
6
+
7
+ attr_accessor :opts, :retry_timeout
8
+
9
+ def initialize(opts)
10
+ @opts = opts
11
+ end
12
+
13
+ end
@@ -0,0 +1,9 @@
1
+ require ::File.expand_path("../spec_helper", __FILE__)
2
+
3
+ describe "fnord" do
4
+
5
+ it "should fnord" do
6
+ 1.should == 1
7
+ end
8
+
9
+ end
@@ -0,0 +1,6 @@
1
+ $: << ::File.expand_path("../lib", __FILE__)
2
+
3
+ require "rubygems"
4
+ require "rspec"
5
+
6
+ require "stompy"
@@ -0,0 +1,19 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "stompy"
6
+ s.version = "0.0.1"
7
+ s.date = Date.today.to_s
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Paul Asmuth"]
10
+ s.email = ["paul@paulasmuth.com"]
11
+ s.homepage = "http://github.com/paulasmuth/stompy"
12
+ s.summary = %q{single threaded client for the STORM protocol}
13
+ s.description = %q{single threaded client for the STORM protocol}
14
+ s.licenses = ["MIT"]
15
+
16
+ s.files = `git ls-files`.split("\n") - [".gitignore", ".rspec", ".travis.yml"]
17
+ s.test_files = `git ls-files -- spec/*`.split("\n")
18
+ s.require_paths = ["lib"]
19
+ end
metadata ADDED
@@ -0,0 +1,54 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: stompy
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Paul Asmuth
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-02-07 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: single threaded client for the STORM protocol
15
+ email:
16
+ - paul@paulasmuth.com
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - README.md
22
+ - lib/stompy.rb
23
+ - lib/stompy/base.rb
24
+ - spec/input_stream_spec.rb
25
+ - spec/spec_helper.rb
26
+ - stompy.gemspec
27
+ homepage: http://github.com/paulasmuth/stompy
28
+ licenses:
29
+ - MIT
30
+ post_install_message:
31
+ rdoc_options: []
32
+ require_paths:
33
+ - lib
34
+ required_ruby_version: !ruby/object:Gem::Requirement
35
+ none: false
36
+ requirements:
37
+ - - ! '>='
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ required_rubygems_version: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ requirements: []
47
+ rubyforge_project:
48
+ rubygems_version: 1.8.24
49
+ signing_key:
50
+ specification_version: 3
51
+ summary: single threaded client for the STORM protocol
52
+ test_files:
53
+ - spec/input_stream_spec.rb
54
+ - spec/spec_helper.rb