liquid-ext 3.3.7 → 3.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/liquid/ext/signal.rb +1 -1
- data/lib/liquid/server.rb +2 -1
- data/lib/liquid/zmq.rb +20 -1
- data/liquid-ext.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e4b18f8dd7bfa1b23edcdbce6c2867a0fc16963
|
4
|
+
data.tar.gz: 8fb5134aa1d32328c1d7e2e6efe28d2d34cafd18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1712c708bc29546b3f3edf7e64fbd2159dd5ebb55dfe15b9a3b6fd28346ef1b2b49429fd6d8fac940d37a946684f6dbd83524fb353731bdedefc36804d10f05
|
7
|
+
data.tar.gz: 3f2ce034b64cd4a0f3c72cc827512a02f24bc3d8072fd51e9860c55b14c43fb0e649d40c7f630b1f4f35d3ba0d1e126496beb044576fcfe141445a7e0cb0b2a0
|
data/Gemfile.lock
CHANGED
data/lib/liquid/ext/signal.rb
CHANGED
data/lib/liquid/server.rb
CHANGED
@@ -6,6 +6,8 @@ module Liquid
|
|
6
6
|
def initialize
|
7
7
|
$log.info("#{self.class.name.downcase} #{RUBY_DESCRIPTION}")
|
8
8
|
$log.info("#{self.class.name.downcase}", env: Env.mode)
|
9
|
+
Signal.register_shutdown_handler { System.exit(0) }
|
10
|
+
Signal.register_shutdown_handler { ZContext.destroy }
|
9
11
|
initialize_raven
|
10
12
|
initialize_tracker
|
11
13
|
initialize_metrics
|
@@ -56,7 +58,6 @@ module Liquid
|
|
56
58
|
ZMachine.logger = $log
|
57
59
|
ZMachine.debug = true if $conf.zmachine.debug
|
58
60
|
ZMachine.heartbeat_interval = 0.1
|
59
|
-
Signal.register_shutdown_handler { ZMachine.stop }
|
60
61
|
end
|
61
62
|
|
62
63
|
def run
|
data/lib/liquid/zmq.rb
CHANGED
@@ -7,6 +7,21 @@ java_import "org.zeromq.ZMQQueue"
|
|
7
7
|
java_import "org.zeromq.ZMsg"
|
8
8
|
java_import "org.zeromq.ZThread"
|
9
9
|
|
10
|
+
class ZMQ
|
11
|
+
class Socket
|
12
|
+
# for performance reason we alias the method here (otherwise it uses reflections all the time!)
|
13
|
+
# super ugly, since we need to dynamically infer the java class of byte[]
|
14
|
+
java_alias :send_byte_buffer, :sendByteBuffer, [Java::JavaNio::ByteBuffer.java_class, Java::int]
|
15
|
+
java_alias :send_byte_array, :send, [[].to_java(:byte).java_class, Java::int]
|
16
|
+
java_alias :recv_byte_array, :recv, [Java::int]
|
17
|
+
|
18
|
+
def write(buffer)
|
19
|
+
bytes = send_byte_buffer(buffer, 0)
|
20
|
+
buffer.position(buffer.position + bytes)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
10
25
|
class ZContext
|
11
26
|
|
12
27
|
def create_socket_with_opts(type, opts = {})
|
@@ -46,8 +61,12 @@ class ZContext
|
|
46
61
|
|
47
62
|
## global context instance
|
48
63
|
|
64
|
+
@mutex = Mutex.new
|
65
|
+
|
49
66
|
def self.instance
|
50
|
-
@
|
67
|
+
@mutex.synchronize do
|
68
|
+
@context ||= new
|
69
|
+
end
|
51
70
|
end
|
52
71
|
|
53
72
|
def self.create_socket(type)
|
data/liquid-ext.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: liquid-ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- LiquidM, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|