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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c6b298f2152dbd3de6e54ac89a48b6f3a66b72e4
4
- data.tar.gz: 04e23d54b86336f934b8e2304feb6348e3d4ea6d
3
+ metadata.gz: 7e4b18f8dd7bfa1b23edcdbce6c2867a0fc16963
4
+ data.tar.gz: 8fb5134aa1d32328c1d7e2e6efe28d2d34cafd18
5
5
  SHA512:
6
- metadata.gz: 6223b39a5f34b7eccc85c62bd1dd131f07ab34999cf13df89ba067d878a0240aab007ecce62348cee7988818b86f1bafc2f5ed81b0a28a3f3d8677d2f32fb109
7
- data.tar.gz: d8cc2bb2736877bf1fb3cb9174b3aa77fad0f16cad37961bc679a5980712fae0f18716fa2e054689dfa7630a9880e948366ba523487d255c0e3fe868b4017f06
6
+ metadata.gz: a1712c708bc29546b3f3edf7e64fbd2159dd5ebb55dfe15b9a3b6fd28346ef1b2b49429fd6d8fac940d37a946684f6dbd83524fb353731bdedefc36804d10f05
7
+ data.tar.gz: 3f2ce034b64cd4a0f3c72cc827512a02f24bc3d8072fd51e9860c55b14c43fb0e649d40c7f630b1f4f35d3ba0d1e126496beb044576fcfe141445a7e0cb0b2a0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- liquid-ext (3.3.7)
4
+ liquid-ext (3.3.8)
5
5
  activesupport
6
6
  erubis
7
7
  jmx4r
@@ -8,7 +8,7 @@ module Signal
8
8
  signals.each do |sig|
9
9
  old = trap(sig) {}
10
10
  trap(sig) do
11
- $log.info("shutdown", handler: block.inspect)
11
+ $log.debug("shutdown", handler: block.inspect)
12
12
  block.call
13
13
  old.call
14
14
  end
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
- @context ||= new
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "liquid-ext"
5
- spec.version = "3.3.7"
5
+ spec.version = "3.3.8"
6
6
  spec.authors = ["LiquidM, Inc."]
7
7
  spec.email = ["opensource@liquidm.com"]
8
8
  spec.description = %q{Ruby core extensions and helper libraries}
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.7
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-17 00:00:00.000000000 Z
11
+ date: 2014-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport