scribe-rb 2.2.rc6 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.md +31 -0
  2. data/scribe-rb.gemspec +1 -1
  3. metadata +19 -13
data/README.md CHANGED
@@ -97,6 +97,37 @@ server = Thrift::SimpleServer.new(processor, transport, transportFactory, protoc
97
97
  server.serve
98
98
  ```
99
99
 
100
+ ### QueuedLogMessageHandler
101
+
102
+ It is not advisable to do any expensive operation within the `Log`
103
+ method. If a response code is not received by Scribe within a few
104
+ seconds (by default), Scribe will assume the connection is dead. If it
105
+ is configured with a buffer store, the same messages will be sent over
106
+ and over again, potentially failing each time.
107
+
108
+ To alleviate this, scribe-rb includes the
109
+ `FacebookService::QueuedLogMessageHandler` class which implements a
110
+ `Log` method that adds messages to a thread-safe in-memory queue. This
111
+ happens quickly and allows expensive operations to occur in a different
112
+ thread that does not block Scribe.
113
+
114
+ An example usage:
115
+
116
+ ```ruby
117
+ handler = FacebookService::QueuedLogMessageHandler("My Scribe Handler")
118
+ handler.message_limit = 100000 # accept up to 100000 messages at a time; if set to nil (default), there is no limit
119
+
120
+ Thread.new do
121
+ while message = handler.queue.pop # will block until a message is available
122
+ # Do some expensive operation with `message`
123
+ end
124
+ end
125
+
126
+ # ...
127
+ server = Thrift::SimpleServer.new(processor, transport, transportFactory, protocolFactory)
128
+ server.serve
129
+ ```
130
+
100
131
  ## Hat Tips
101
132
 
102
133
  * [Installing and Using Scribe with Ruby on Mac OS](http://kpumuk.info/development/installing-and-using-scribe-with-ruby-on-mac-os/)
data/scribe-rb.gemspec CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "scribe-rb"
6
- s.version = "2.2.rc6"
6
+ s.version = "2.2.0"
7
7
  s.authors = ["Andy Lindeman"]
8
8
  s.email = ["andy@highgroove.com"]
9
9
  s.homepage = "http://github.com/highgroove/scribe-rb"
metadata CHANGED
@@ -1,19 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scribe-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.rc6
5
- prerelease: 4
4
+ version: 2.2.0
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Andy Lindeman
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-21 00:00:00.000000000Z
12
+ date: 2011-10-02 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thrift
16
- requirement: &2164580280 !ruby/object:Gem::Requirement
16
+ requirement: &2169948600 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.7.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2164580280
24
+ version_requirements: *2169948600
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rake
27
- requirement: &2164579860 !ruby/object:Gem::Requirement
27
+ requirement: &2169948020 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *2164579860
35
+ version_requirements: *2169948020
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &2164579320 !ruby/object:Gem::Requirement
38
+ requirement: &2169947280 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 2.6.0
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *2164579320
46
+ version_requirements: *2169947280
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: timecop
49
- requirement: &2164578900 !ruby/object:Gem::Requirement
49
+ requirement: &2169946640 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *2164578900
57
+ version_requirements: *2169946640
58
58
  description: Everything you need to build a Ruby producer/client or consumer/server
59
59
  of Scribe messages
60
60
  email:
@@ -96,12 +96,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
96
96
  - - ! '>='
97
97
  - !ruby/object:Gem::Version
98
98
  version: '0'
99
+ segments:
100
+ - 0
101
+ hash: 3167216979057722603
99
102
  required_rubygems_version: !ruby/object:Gem::Requirement
100
103
  none: false
101
104
  requirements:
102
- - - ! '>'
105
+ - - ! '>='
103
106
  - !ruby/object:Gem::Version
104
- version: 1.3.1
107
+ version: '0'
108
+ segments:
109
+ - 0
110
+ hash: 3167216979057722603
105
111
  requirements: []
106
112
  rubyforge_project:
107
113
  rubygems_version: 1.8.10