omq-rfc-clientserver 0.1.0 → 0.1.1
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 +4 -4
- data/lib/omq/client_server.rb +11 -9
- data/lib/omq/rfc/clientserver/version.rb +1 -1
- data/lib/omq/rfc/clientserver.rb +0 -1
- metadata +3 -4
- data/lib/omq/single_frame.rb +0 -23
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d3d657d656abf8f6ef632439303ec0059551b1d899f7b49a101f53e77dd628ba
|
|
4
|
+
data.tar.gz: 0b1320c47bfab9a99ba4db0c60debefe0b1656fcd7dc12ee53037d551c38a2c5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c79ddc223fc0558a46d941dc5e2cc394e619d67464a02d64ec2367a36765d5fc4e18c4d6e0924d1992a8c4185053449fe1b076987b1392ddc2f72cbd104b4a3d
|
|
7
|
+
data.tar.gz: 74966ec22584ef760f6ad14dac08e1a348940744b15bf38956549e8ad63389fdd2a5d0052a805d3277290d9d0dfd4bc3896889d82742e39c68bdfa505adb9cdc
|
data/lib/omq/client_server.rb
CHANGED
|
@@ -12,11 +12,12 @@ module OMQ
|
|
|
12
12
|
# Creates a new CLIENT socket.
|
|
13
13
|
#
|
|
14
14
|
# @param endpoints [String, Array<String>, nil] endpoint(s) to connect to
|
|
15
|
-
# @param linger [
|
|
15
|
+
# @param linger [Numeric] linger period in seconds (Float::INFINITY = wait forever, 0 = drop)
|
|
16
16
|
# @param backend [Object, nil] optional transport backend
|
|
17
|
-
def initialize(endpoints = nil, linger:
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
def initialize(endpoints = nil, linger: Float::INFINITY, backend: nil)
|
|
18
|
+
init_engine(:CLIENT, backend: backend)
|
|
19
|
+
@options.linger = linger
|
|
20
|
+
attach_endpoints(endpoints, default: :connect)
|
|
20
21
|
end
|
|
21
22
|
end
|
|
22
23
|
|
|
@@ -33,11 +34,12 @@ module OMQ
|
|
|
33
34
|
# Creates a new SERVER socket.
|
|
34
35
|
#
|
|
35
36
|
# @param endpoints [String, Array<String>, nil] endpoint(s) to bind to
|
|
36
|
-
# @param linger [
|
|
37
|
+
# @param linger [Numeric] linger period in seconds (Float::INFINITY = wait forever, 0 = drop)
|
|
37
38
|
# @param backend [Object, nil] optional transport backend
|
|
38
|
-
def initialize(endpoints = nil, linger:
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
def initialize(endpoints = nil, linger: Float::INFINITY, backend: nil)
|
|
40
|
+
init_engine(:SERVER, backend: backend)
|
|
41
|
+
@options.linger = linger
|
|
42
|
+
attach_endpoints(endpoints, default: :bind)
|
|
41
43
|
end
|
|
42
44
|
|
|
43
45
|
|
|
@@ -49,7 +51,7 @@ module OMQ
|
|
|
49
51
|
#
|
|
50
52
|
def send_to(routing_id, message)
|
|
51
53
|
parts = [routing_id.b.freeze, message.b.freeze]
|
|
52
|
-
|
|
54
|
+
Reactor.run(timeout: @options.write_timeout) { @engine.enqueue_send(parts) }
|
|
53
55
|
self
|
|
54
56
|
end
|
|
55
57
|
end
|
data/lib/omq/rfc/clientserver.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: omq-rfc-clientserver
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Patrik Wenger
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: '0.
|
|
18
|
+
version: '0.20'
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - ">="
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: '0.
|
|
25
|
+
version: '0.20'
|
|
26
26
|
description: CLIENT and SERVER socket types implementing ZeroMQ RFC 41 for the OMQ
|
|
27
27
|
pure-Ruby ZeroMQ library.
|
|
28
28
|
email:
|
|
@@ -38,7 +38,6 @@ files:
|
|
|
38
38
|
- lib/omq/rfc/clientserver/version.rb
|
|
39
39
|
- lib/omq/routing/client.rb
|
|
40
40
|
- lib/omq/routing/server.rb
|
|
41
|
-
- lib/omq/single_frame.rb
|
|
42
41
|
homepage: https://github.com/paddor/omq-rfc41-clientserver
|
|
43
42
|
licenses:
|
|
44
43
|
- ISC
|
data/lib/omq/single_frame.rb
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module OMQ
|
|
4
|
-
# Mixin that rejects multipart messages.
|
|
5
|
-
#
|
|
6
|
-
# All draft socket types (CLIENT, SERVER, RADIO, DISH, SCATTER,
|
|
7
|
-
# GATHER, PEER, CHANNEL) require single-frame messages for
|
|
8
|
-
# thread-safe atomic operations.
|
|
9
|
-
#
|
|
10
|
-
module SingleFrame
|
|
11
|
-
# Sends a message, rejecting multipart messages.
|
|
12
|
-
#
|
|
13
|
-
# @param message [String, Array<String>] message to send (must be single-frame)
|
|
14
|
-
# @raise [ArgumentError] if a multipart message is provided
|
|
15
|
-
# @return [void]
|
|
16
|
-
def send(message)
|
|
17
|
-
if message.is_a?(Array) && message.size > 1
|
|
18
|
-
raise ArgumentError, "#{self.class} does not support multipart messages"
|
|
19
|
-
end
|
|
20
|
-
super
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|