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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 775515d7b92467fda62d2725c5ecb5b118b0ad5c
4
- data.tar.gz: c8a1f6989dd3f98fc84cff626fb2065cebd0ee5e
3
+ metadata.gz: e8ef3cdf9c36a74cb4162c66ce6ca03398181b3c
4
+ data.tar.gz: 0d7ee7477c944589d831985a971390a6776a10df
5
5
  SHA512:
6
- metadata.gz: 5cbef86bc63786358a6216e354a5e3944a57f96e2273299486438e040760aeaac7ea41199eb98050973041724dc7818577bf92bb7252a70e526b5abccd0c9a45
7
- data.tar.gz: 7f18c0126e0871e05128ff59e73c9c673c74033c393dfac48ddd0187934cbf66a6edaa29a0032af47744c7d7c847d6d6e9853ad24202dd5ef255d57ac227c449
6
+ metadata.gz: 1cd7631c6317db07f0bee642456244f0cc816482686d114f8129e03d911edce0cc7883cde39859bb5f0d5b17ddf4fb73e3481e07a72058723834b7da4601d7c4
7
+ data.tar.gz: 617a5fd46326812e257df74d4de00baa5527f98066817a96a5cb13f76f94640e812774b2ef90f5981be2a6e8f46e8cbd5d9a5fed5930fa41351685799a3d8606
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -9,11 +9,11 @@ class DynarexEvents < DynarexCron
9
9
 
10
10
  attr_reader :to_a
11
11
 
12
- # options: e.g. sps_address, 'sps', drb_server: 58000
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, drb_server: nil}.merge options
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[:drb_server] then
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[:drb_server], self
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
- while @running == true
62
- iterate @cron_events
63
- sleep 60 # wait for 60 seconds
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.8
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-10-28 00:00:00.000000000 Z
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