hoptoad_zmq_notifier 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -4,6 +4,13 @@ Hoptoad notifier extension for speaking to the server over 0mq socket.
4
4
 
5
5
  One should use this library to speak to Errbit server extended by Errbit 0MQ Handler (https://github.com/oruen/errbit_zmq_handler)
6
6
 
7
+ Advantage of using Hoptoad 0MQ Notifier is async notices sending. You no longer block your app flow with requests to exception handling server.
8
+ 0MQ does all that stuff.
9
+
10
+ == Requirements
11
+
12
+ Ruby 1.9 or JRuby. ffi-rzmq is not working with MRI (and REE) 1.8.7.
13
+
7
14
  == Installation
8
15
 
9
16
  Install zeromq 2.1 from http://www.zeromq.org/ or your favorite package system.
@@ -15,13 +22,15 @@ Install the gem:
15
22
  == Usage
16
23
 
17
24
  In the same initializer you initialize your Hoptoad Notifier client:
25
+ # Your Errbit server config. Only api_key is still relevant.
18
26
  HoptoadNotifier.configure do |config|
19
27
  config.api_key = 'ba134e3c7fab581e8685cde0a5e68728'
20
28
  config.host = 'localhost'
21
29
  config.port = 3000
22
30
  end
23
31
 
24
- HoptoadZmqHandler.configure do |config|
32
+ # 0MQ notifier config
33
+ HoptoadZmqNotifier.configure do |config|
25
34
  # Address to connect to send exception notifications
26
35
  config.uri = "tcp://127.0.0.1:9998"
27
36
  end
@@ -24,6 +24,7 @@ module HoptoadZmqNotifier
24
24
  s = zmq_context.socket ZMQ::PUB
25
25
  s.connect @uri
26
26
  s.setsockopt(ZMQ::HWM, mailbox_size)
27
+ at_exit { s.close }
27
28
  s
28
29
  end
29
30
  end
@@ -6,7 +6,7 @@ module HoptoadZmqNotifier
6
6
  class Sender
7
7
  def send_to_hoptoad data
8
8
  logger.debug { "Sending request to #{@uri}:\n#{data}" } if logger
9
- socket.send_string data
9
+ socket.send_string data, ZMQ::NOBLOCK
10
10
  end
11
11
 
12
12
  def initialize(options = {})
@@ -1,3 +1,3 @@
1
1
  module HoptoadZmqNotifier
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -23,7 +23,7 @@ describe HoptoadZmqNotifier::Sender do
23
23
 
24
24
  it "should send messages via 0MQ" do
25
25
  HoptoadNotifier.sender.send_to_hoptoad(@message)
26
- sleep 1
26
+ sleep 0.1
27
27
  @subscriber.recv_string(ZMQ::NOBLOCK).should == @message
28
28
  end
29
29
  end
metadata CHANGED
@@ -1,108 +1,126 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: hoptoad_zmq_notifier
3
- version: !ruby/object:Gem::Version
4
- version: 0.1.0
5
- prerelease:
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 1
9
+ version: 0.1.1
6
10
  platform: ruby
7
- authors:
8
- - Nick Recobra
11
+ authors:
12
+ - Nick Recobra
9
13
  autorequire:
10
14
  bindir: bin
11
15
  cert_chain: []
12
- date: 2011-03-03 00:00:00.000000000 +03:00
16
+
17
+ date: 2011-03-29 00:00:00 +04:00
13
18
  default_executable:
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: hoptoad_notifier
17
- requirement: &2153369360 !ruby/object:Gem::Requirement
18
- none: false
19
- requirements:
20
- - - ! '>'
21
- - !ruby/object:Gem::Version
22
- version: '0'
23
- type: :runtime
24
- prerelease: false
25
- version_requirements: *2153369360
26
- - !ruby/object:Gem::Dependency
27
- name: ffi-rzmq
28
- requirement: &2153368940 !ruby/object:Gem::Requirement
29
- none: false
30
- requirements:
31
- - - ! '>='
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: *2153368940
37
- - !ruby/object:Gem::Dependency
38
- name: ffi
39
- requirement: &2153368480 !ruby/object:Gem::Requirement
40
- none: false
41
- requirements:
42
- - - ! '>='
43
- - !ruby/object:Gem::Version
44
- version: '0'
45
- type: :runtime
46
- prerelease: false
47
- version_requirements: *2153368480
48
- - !ruby/object:Gem::Dependency
49
- name: rspec
50
- requirement: &2153367980 !ruby/object:Gem::Requirement
51
- none: false
52
- requirements:
53
- - - ! '>='
54
- - !ruby/object:Gem::Version
55
- version: 2.5.0
56
- type: :development
57
- prerelease: false
58
- version_requirements: *2153367980
59
- description: Hoptoad Notifier extension making hoptoad client speak to server via
60
- 0MQ socket.
61
- email:
62
- - oruenu@gmail.com
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: hoptoad_notifier
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">"
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ version: "0"
30
+ type: :runtime
31
+ version_requirements: *id001
32
+ - !ruby/object:Gem::Dependency
33
+ name: ffi-rzmq
34
+ prerelease: false
35
+ requirement: &id002 !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ segments:
40
+ - 0
41
+ version: "0"
42
+ type: :runtime
43
+ version_requirements: *id002
44
+ - !ruby/object:Gem::Dependency
45
+ name: ffi
46
+ prerelease: false
47
+ requirement: &id003 !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ segments:
52
+ - 0
53
+ version: "0"
54
+ type: :runtime
55
+ version_requirements: *id003
56
+ - !ruby/object:Gem::Dependency
57
+ name: rspec
58
+ prerelease: false
59
+ requirement: &id004 !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ segments:
64
+ - 2
65
+ - 5
66
+ - 0
67
+ version: 2.5.0
68
+ type: :development
69
+ version_requirements: *id004
70
+ description: Hoptoad Notifier extension making hoptoad client speak to server via 0MQ socket.
71
+ email:
72
+ - oruenu@gmail.com
63
73
  executables: []
74
+
64
75
  extensions: []
76
+
65
77
  extra_rdoc_files: []
66
- files:
67
- - .gitignore
68
- - Gemfile
69
- - MIT-LICENSE
70
- - README.rdoc
71
- - Rakefile
72
- - hoptoad_notifier_zmq.gemspec
73
- - lib/hoptoad_zmq_notifier.rb
74
- - lib/hoptoad_zmq_notifier/configuration.rb
75
- - lib/hoptoad_zmq_notifier/sender.rb
76
- - lib/hoptoad_zmq_notifier/version.rb
77
- - spec/lib/hoptoad_notifier_zmq/configuration_spec.rb
78
- - spec/lib/hoptoad_notifier_zmq/sender_spec.rb
79
- - spec/spec_helper.rb
78
+
79
+ files:
80
+ - .gitignore
81
+ - Gemfile
82
+ - MIT-LICENSE
83
+ - README.rdoc
84
+ - Rakefile
85
+ - hoptoad_notifier_zmq.gemspec
86
+ - lib/hoptoad_zmq_notifier.rb
87
+ - lib/hoptoad_zmq_notifier/configuration.rb
88
+ - lib/hoptoad_zmq_notifier/sender.rb
89
+ - lib/hoptoad_zmq_notifier/version.rb
90
+ - spec/lib/hoptoad_notifier_zmq/configuration_spec.rb
91
+ - spec/lib/hoptoad_notifier_zmq/sender_spec.rb
92
+ - spec/spec_helper.rb
80
93
  has_rdoc: true
81
- homepage: ''
94
+ homepage: ""
82
95
  licenses: []
96
+
83
97
  post_install_message:
84
98
  rdoc_options: []
85
- require_paths:
86
- - lib
87
- required_ruby_version: !ruby/object:Gem::Requirement
88
- none: false
89
- requirements:
90
- - - ! '>='
91
- - !ruby/object:Gem::Version
92
- version: '0'
93
- required_rubygems_version: !ruby/object:Gem::Requirement
94
- none: false
95
- requirements:
96
- - - ! '>='
97
- - !ruby/object:Gem::Version
98
- version: '0'
99
+
100
+ require_paths:
101
+ - lib
102
+ required_ruby_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ segments:
107
+ - 0
108
+ version: "0"
109
+ required_rubygems_version: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ segments:
114
+ - 0
115
+ version: "0"
99
116
  requirements: []
117
+
100
118
  rubyforge_project: hoptoad_notifier_zmq
101
- rubygems_version: 1.5.2
119
+ rubygems_version: 1.3.6
102
120
  signing_key:
103
121
  specification_version: 3
104
122
  summary: 0MQ client for Errbit
105
- test_files:
106
- - spec/lib/hoptoad_notifier_zmq/configuration_spec.rb
107
- - spec/lib/hoptoad_notifier_zmq/sender_spec.rb
108
- - spec/spec_helper.rb
123
+ test_files:
124
+ - spec/lib/hoptoad_notifier_zmq/configuration_spec.rb
125
+ - spec/lib/hoptoad_notifier_zmq/sender_spec.rb
126
+ - spec/spec_helper.rb