beetle 0.3.3 → 0.3.4
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.
- checksums.yaml +4 -4
- data/examples/test_publisher.rb +32 -0
- data/lib/beetle/configuration.rb +4 -0
- data/lib/beetle/deduplication_store.rb +1 -1
- data/lib/beetle/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa1aeb6c9cc3af6c5918a5b329e5203ed11cf5af
|
4
|
+
data.tar.gz: 1355e82b1f4f96ccc27efb8c600805b3e8d51a74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88f407ac509eaa3b28f8f8e81735ee4de0ff3a531552001cfb75e9a1a67f3d9c25ec325cd6d08709151cc634b1189c60220e8df7a816207c49888e1efd76266f
|
7
|
+
data.tar.gz: 8d688ac133f73f3d48ec4b7cdf75023d94a92c61f3491dfa9346555b3da5a5e731277dee7c2bd73534e59f0efd20fe27d302ff895729ff32adffeb973cbb5a0f
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# attempts.rb
|
2
|
+
# this example shows you how to use the exception limiting feature of beetle
|
3
|
+
# it allows you to control the number of retries your handler will go through
|
4
|
+
# with one message before giving up on it
|
5
|
+
#
|
6
|
+
# ! check the examples/README.rdoc for information on starting your redis/rabbit !
|
7
|
+
#
|
8
|
+
# start it with ruby attempts.rb
|
9
|
+
|
10
|
+
require "rubygems"
|
11
|
+
require File.expand_path("../lib/beetle", File.dirname(__FILE__))
|
12
|
+
require "eventmachine"
|
13
|
+
|
14
|
+
# set Beetle log level to info, less noisy than debug
|
15
|
+
Beetle.config.logger.level = Logger::INFO
|
16
|
+
|
17
|
+
# setup client
|
18
|
+
client = Beetle::Client.new
|
19
|
+
client.register_message(:test)
|
20
|
+
|
21
|
+
n = 0
|
22
|
+
EM.run do
|
23
|
+
EM.add_periodic_timer(0.1) do
|
24
|
+
data = (n+=1)
|
25
|
+
client.logger.info "publishing #{data}"
|
26
|
+
client.publish(:test, data)
|
27
|
+
end
|
28
|
+
trap("INT") do
|
29
|
+
client.stop_publishing
|
30
|
+
EM.stop_event_loop
|
31
|
+
end
|
32
|
+
end
|
data/lib/beetle/configuration.rb
CHANGED
@@ -51,6 +51,9 @@ module Beetle
|
|
51
51
|
# consider this a highly experimental feature for now.
|
52
52
|
attr_accessor :publishing_timeout
|
53
53
|
|
54
|
+
# directory to store large intermediate files (defaults '/tmp')
|
55
|
+
attr_accessor :tmpdir
|
56
|
+
|
54
57
|
# external config file (defaults to <tt>no file</tt>)
|
55
58
|
attr_reader :config_file
|
56
59
|
|
@@ -75,6 +78,7 @@ module Beetle
|
|
75
78
|
self.password = "guest"
|
76
79
|
|
77
80
|
self.publishing_timeout = 0
|
81
|
+
self.tmpdir = "/tmp"
|
78
82
|
|
79
83
|
self.log_file = STDOUT
|
80
84
|
end
|
@@ -57,7 +57,7 @@ module Beetle
|
|
57
57
|
logger.warn "no slave available, falling back to master."
|
58
58
|
connection = redis
|
59
59
|
end
|
60
|
-
file = "/
|
60
|
+
file = "#{@config.tmpdir}/beetle_redis_expire_keys_#{$$}.txt"
|
61
61
|
cmd = "redis-cli -h #{connection.host} -p #{connection.port} -n #{@config.redis_db} keys 'msgid:*:expires' > #{file}"
|
62
62
|
logger.info "retrieving expire keys: '#{cmd}'"
|
63
63
|
if system(cmd)
|
data/lib/beetle/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beetle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Kaes
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2013-12-
|
15
|
+
date: 2013-12-16 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: uuid4r
|
@@ -183,6 +183,7 @@ files:
|
|
183
183
|
- examples/redundant.rb
|
184
184
|
- examples/rpc.rb
|
185
185
|
- examples/simple.rb
|
186
|
+
- examples/test_publisher.rb
|
186
187
|
- lib/beetle/base.rb
|
187
188
|
- lib/beetle/client.rb
|
188
189
|
- lib/beetle/commands/configuration_client.rb
|