allq 0.2.7 → 0.2.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4734e699bb46e5673f0ebbd2767395b3cb6bb486
4
- data.tar.gz: 6e203ba2a656726e5e12690a900cee4995512c6e
3
+ metadata.gz: 2fc9bb8ce4c30ef64e02a15976fea3b1fa95c55c
4
+ data.tar.gz: 572e20aaf3340941cb87480965a9dbf1b1f06edb
5
5
  SHA512:
6
- metadata.gz: c0272f731ea498ca15f3a7dc3ad3a0c45fadca88dc5683572f4e0ab8c904c081a525630c5d3e08e95ef6ded91892fa722ac4be11e6b7b7a3c1060fdf76c2078d
7
- data.tar.gz: 055dc4c1af3431d540aee4e54d281f2e2d15fc1f1e3bb8d0c2c4c03e0eccc3a59d4a16951ef6f4f0fe5ed021494af72e7d806cd8b51c68129347ae8b1a1c6e8c
6
+ metadata.gz: b6131a91fe939cd4a1c90baecff04df4d03c17459b7ffd742ad5c0b0582dcd02534f07dfbc63750b13a70555b882d8dcaf7fe7ce2398213d82e0bff544e37b18
7
+ data.tar.gz: cffbdab95f6135fa3a3e407b698f5318abaebad5d1cb6aa16b911245c27561b42e8507b1ee6eeb5b81f035383da524a86abbf58583d6807434a30af692072c2b
@@ -25,6 +25,7 @@ class AllQ
25
25
  def send_hash_as_json(data_hash)
26
26
  transmit_data = data_hash.to_json
27
27
  result = nil
28
+ puts "transmitting data: #{transmit_data}"
28
29
  @connection.transmit(transmit_data) do |response|
29
30
  result = response
30
31
  end
@@ -7,20 +7,8 @@ class AllQ
7
7
  URL = ENV['ALLQ_CLIENT_URL'] || '127.0.0.1:7766'
8
8
  def initialize(url = nil)
9
9
  url = URL if url.nil?
10
-
11
- @connection = AllQ::Connection.new(url)
12
- @get_action = AllQ::Get.new(@connection, self)
13
- @put_action = AllQ::Put.new(@connection, self)
14
- @done_action = AllQ::Done.new(@connection, self)
15
- @stats_action = AllQ::Stats.new(@connection, self)
16
- @release_action = AllQ::Release.new(@connection, self)
17
- @touch_action = AllQ::Touch.new(@connection, self)
18
- @kick_action = AllQ::Kick.new(@connection, self)
19
- @bury_action = AllQ::Bury.new(@connection, self)
20
- @clear_action = AllQ::Clear.new(@connection, self)
21
- @peek_action = AllQ::Peek.new(@connection, self)
22
- @delete_action = AllQ::Delete.new(@connection, self)
23
- @parent_job_action = AllQ::ParentJob.new(@connection, self)
10
+ @connection = nil
11
+ reload
24
12
  end
25
13
 
26
14
  def parent_job(tube, body, ttl: 3600, delay: 0, parent_id: nil, priority: 5, limit: nil, noop: false)
@@ -98,6 +86,27 @@ class AllQ
98
86
  @release_action.snd(job_id: job.id, delay: delay)
99
87
  end
100
88
 
89
+ def close
90
+ @connection.close
91
+ end
92
+
93
+ def reload
94
+ @connection.close if @connection
95
+ @connection = AllQ::Connection.new(url)
96
+ @get_action = AllQ::Get.new(@connection, self)
97
+ @put_action = AllQ::Put.new(@connection, self)
98
+ @done_action = AllQ::Done.new(@connection, self)
99
+ @stats_action = AllQ::Stats.new(@connection, self)
100
+ @release_action = AllQ::Release.new(@connection, self)
101
+ @touch_action = AllQ::Touch.new(@connection, self)
102
+ @kick_action = AllQ::Kick.new(@connection, self)
103
+ @bury_action = AllQ::Bury.new(@connection, self)
104
+ @clear_action = AllQ::Clear.new(@connection, self)
105
+ @peek_action = AllQ::Peek.new(@connection, self)
106
+ @delete_action = AllQ::Delete.new(@connection, self)
107
+ @parent_job_action = AllQ::ParentJob.new(@connection, self)
108
+ end
109
+
101
110
 
102
111
  end
103
112
  end
@@ -69,6 +69,7 @@ class AllQ
69
69
  job = Job.new(id, client, tube, body, expireds, releases)
70
70
  return job
71
71
  rescue => ex
72
+ puts caller
72
73
  puts "Server value: #{hash}"
73
74
  puts "Can't create job, version mismatch?"
74
75
  puts "Invalid job data #{ex.message}"
@@ -1,3 +1,3 @@
1
1
  module Allq
2
- VERSION = "0.2.7"
2
+ VERSION = "0.2.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: allq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-02 00:00:00.000000000 Z
11
+ date: 2018-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler