dynarex-events 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/dynarex-events.rb +18 -9
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8ef3cdf9c36a74cb4162c66ce6ca03398181b3c
|
4
|
+
data.tar.gz: 0d7ee7477c944589d831985a971390a6776a10df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cd7631c6317db07f0bee642456244f0cc816482686d114f8129e03d911edce0cc7883cde39859bb5f0d5b17ddf4fb73e3481e07a72058723834b7da4601d7c4
|
7
|
+
data.tar.gz: 617a5fd46326812e257df74d4de00baa5527f98066817a96a5cb13f76f94640e812774b2ef90f5981be2a6e8f46e8cbd5d9a5fed5930fa41351685799a3d8606
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/dynarex-events.rb
CHANGED
@@ -9,11 +9,11 @@ class DynarexEvents < DynarexCron
|
|
9
9
|
|
10
10
|
attr_reader :to_a
|
11
11
|
|
12
|
-
# options: e.g. sps_address
|
12
|
+
# options: e.g. sps_address: 'sps', drb_port: 58000
|
13
13
|
#
|
14
14
|
def initialize(dynarex_file=nil, options={})
|
15
15
|
|
16
|
-
opt = {sps_address: nil,
|
16
|
+
opt = {sps_address: nil, sps_port: '59000', drb_port: nil}.merge options
|
17
17
|
|
18
18
|
@entries, @other_entries, @cron_events = [], [], []
|
19
19
|
|
@@ -22,12 +22,12 @@ class DynarexEvents < DynarexCron
|
|
22
22
|
|
23
23
|
@sps_address = opt[:sps_address]
|
24
24
|
|
25
|
-
if opt[:
|
25
|
+
if opt[:drb_port] then
|
26
26
|
|
27
27
|
Thread.new {
|
28
28
|
|
29
29
|
# start up the DRb service
|
30
|
-
DRb.start_service 'druby://:' + opt[:
|
30
|
+
DRb.start_service 'druby://:' + opt[:drb_port], self
|
31
31
|
|
32
32
|
# wait for the DRb service to finish before exiting
|
33
33
|
DRb.thread.join
|
@@ -55,14 +55,23 @@ class DynarexEvents < DynarexCron
|
|
55
55
|
alias refresh load_events
|
56
56
|
|
57
57
|
def start
|
58
|
+
|
58
59
|
@running = true
|
59
60
|
puts '[' + Time.now.strftime(DF) + '] DynarexEvents started'
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
61
|
+
params = {uri: "ws://%s:%s" % [@sps_address, @sps_port]}
|
62
|
+
|
63
|
+
c = WebSocket::EventMachine::Client
|
64
|
+
|
65
|
+
EventMachine.run do
|
66
|
+
|
67
|
+
@ws = c.connect(params)
|
68
|
+
|
69
|
+
EM.add_periodic_timer(60) do
|
70
|
+
iterate @cron_events
|
71
|
+
end
|
72
|
+
|
64
73
|
end
|
65
|
-
end
|
74
|
+
end
|
66
75
|
|
67
76
|
def to_a()
|
68
77
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynarex-events
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
wC9cuVCUDZfVJ5fj3LNV2ZYGD4xDEqRa7w7DJluVaQSyYKIUqTFf7yOG5D2hu/OR
|
32
32
|
5cbgqBz0i1h9/Q==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2013-
|
34
|
+
date: 2013-11-23 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: dynarex_cron
|
metadata.gz.sig
CHANGED
Binary file
|