hawking 0.2 → 0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/hawking.rb +5 -6
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bfaf1499ae4d60b4d120b7cbbbcaf4e3857b2ee5
4
- data.tar.gz: 7838b9bd81fc9143683142e0ef157c4bdd540d0d
3
+ metadata.gz: b7485bb68a0e24f8a22dc243e5fd62e2ebd4aacb
4
+ data.tar.gz: 19dcdab3aa91a5729151646d15d3611c05cd0f9b
5
5
  SHA512:
6
- metadata.gz: 40a663df64d4103861171fe57b2519d30a15b5387bc378cea54bc4ebdd446dbcc36dde015221659de0b81d124aafe3cc609b89cb01c97522a5e1a95ad8718b1d
7
- data.tar.gz: ec308bad645f9efcdc537b94000ba3fdc04302f93e994c169316a9fe83d2b022fe9f0212bb32e328dc28708019d1c6636b96a451dd33d23784c4bd977c86406c
6
+ metadata.gz: 69dca7de145aa92aad05bdd6bed9f9e49b01c12691c33619e6ff232bc9c2e2e62498e746fc53067ff55189f0f6f7db4fffd3527d700028f6d274d0cf66bad21e
7
+ data.tar.gz: b40b7f4d5ece079ae91c0e4afeb0a6ef45b3e35059db8eefea1435d60b60f9a574d7d21abf234b5bec4cc5499ff16c6f05c29f8b8a9e6b8dd72792dc450aef0c
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hawking (0.1)
4
+ hawking (0.2)
5
5
  json_pure
6
6
 
7
7
  GEM
@@ -5,10 +5,10 @@ require "timeout"
5
5
  module Hawking
6
6
  extend self
7
7
 
8
- VERSION = "0.2"
8
+ VERSION = "0.3"
9
9
 
10
10
  def run
11
- puts "Working #{@@jobs.size} jobs: [ #{@@jobs.keys.join(' ')} ]\r\r"
11
+ puts "Working #{@@jobs.size} jobs: [ #{@@jobs.keys.join(' ')} ]"
12
12
 
13
13
  server = TCPServer.open "127.0.0.1", 4481
14
14
 
@@ -17,12 +17,11 @@ module Hawking
17
17
 
18
18
  def work_jobs(server)
19
19
  Thread.start(server.accept) do |listener|
20
+ job = JSON.parse listener.gets, symbolize_names: true
21
+ puts "Working on #{job[:queue]} (#{job[:data]})"
22
+
20
23
  begin
21
24
  Timeout::timeout(20) do
22
- puts "Working on #{job[:queue]} (#{job[:data]})\r"
23
-
24
- job = JSON.parse listener.gets, symbolize_names: true
25
-
26
25
  handler = @@jobs[job[:queue]]
27
26
  handler.call(job[:data])
28
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hawking
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.2'
4
+ version: '0.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rogério Zambon