nanomsg 0.3.2 → 0.3.3
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.
- data/HISTORY +1 -0
- data/README +2 -2
- data/examples/aborting.rb +4 -0
- data/examples/bus.rb +3 -0
- data/examples/bus_device.rb +3 -0
- data/examples/pair.rb +2 -0
- data/ext/init.c +18 -14
- metadata +2 -2
data/HISTORY
CHANGED
data/README
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
TLDR
|
3
2
|
|
4
3
|
An idiomatic nanomsg wrapper for Ruby.
|
@@ -27,7 +26,8 @@ stack. At the moment, nanomsg library supports following transports:
|
|
27
26
|
|
28
27
|
DOCUMENTATION
|
29
28
|
|
30
|
-
Check out the examples folder of the project. See
|
29
|
+
Check out the examples folder of the project. See
|
30
|
+
http://kschiess.bitbucket.org/nanomsg/ and http://nanomsg.org/ for more
|
31
31
|
documentation.
|
32
32
|
|
33
33
|
SYNOPSIS
|
data/examples/aborting.rb
CHANGED
data/examples/bus.rb
CHANGED
data/examples/bus_device.rb
CHANGED
data/examples/pair.rb
CHANGED
data/ext/init.c
CHANGED
@@ -77,20 +77,6 @@ sock_get(VALUE socket)
|
|
77
77
|
return psock->socket;
|
78
78
|
}
|
79
79
|
|
80
|
-
static int
|
81
|
-
nn_get_rcv_fd(int sock)
|
82
|
-
{
|
83
|
-
int fd;
|
84
|
-
size_t size = sizeof(fd);
|
85
|
-
int err;
|
86
|
-
|
87
|
-
err = nn_getsockopt(sock, NN_SOL_SOCKET, NN_RCVFD, &fd, &size);
|
88
|
-
if (err < 0)
|
89
|
-
return err;
|
90
|
-
|
91
|
-
return fd;
|
92
|
-
}
|
93
|
-
|
94
80
|
static VALUE
|
95
81
|
sock_alloc(VALUE klass)
|
96
82
|
{
|
@@ -332,6 +318,23 @@ sub_sock_subscribe(VALUE socket, VALUE channel)
|
|
332
318
|
return socket;
|
333
319
|
}
|
334
320
|
|
321
|
+
static VALUE
|
322
|
+
sub_sock_unsubscribe(VALUE socket, VALUE channel)
|
323
|
+
{
|
324
|
+
int sock = sock_get(socket);
|
325
|
+
int err;
|
326
|
+
|
327
|
+
err = nn_setsockopt(
|
328
|
+
sock, NN_SUB, NN_SUB_UNSUBSCRIBE,
|
329
|
+
StringValuePtr(channel),
|
330
|
+
RSTRING_LEN(channel)
|
331
|
+
);
|
332
|
+
if (err < 0)
|
333
|
+
RAISE_SOCK_ERROR;
|
334
|
+
|
335
|
+
return socket;
|
336
|
+
}
|
337
|
+
|
335
338
|
static VALUE
|
336
339
|
srvy_set_deadline(VALUE self, VALUE deadline)
|
337
340
|
{
|
@@ -459,6 +462,7 @@ Init_nanomsg(void)
|
|
459
462
|
rb_define_method(cPubSocket, "initialize", pub_sock_init, -1);
|
460
463
|
rb_define_method(cSubSocket, "initialize", sub_sock_init, -1);
|
461
464
|
rb_define_method(cSubSocket, "subscribe", sub_sock_subscribe, 1);
|
465
|
+
rb_define_method(cSubSocket, "unsubscribe", sub_sock_unsubscribe, 1);
|
462
466
|
|
463
467
|
rb_define_method(cSurveySocket, "initialize", srvy_sock_init, -1);
|
464
468
|
rb_define_method(cSurveySocket, "deadline=", srvy_set_deadline, 1);
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nanomsg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-11-25 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: ! " nanomsg library is a high-performance implementation of several
|
15
15
|
\"scalability \n protocols\". Scalability protocol's job is to define how multiple
|