Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
baea4066
Commit
baea4066
authored
Jun 17, 2016
by
Fedor Sheremetyev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Store manual subscriptions in XPUB and send them out on pipe termination.
parent
813c7381
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
4 deletions
+22
-4
xpub.cpp
src/xpub.cpp
+19
-4
xpub.hpp
src/xpub.hpp
+3
-0
No files found.
src/xpub.cpp
View file @
baea4066
...
...
@@ -92,6 +92,12 @@ void zmq::xpub_t::xread_activated (pipe_t *pipe_)
if
(
size
>
0
&&
(
*
data
==
0
||
*
data
==
1
))
{
if
(
manual
)
{
// Store manual subscription to use on termination
if
(
*
data
==
0
)
manual_subscriptions
.
rm
(
data
+
1
,
size
-
1
,
pipe_
);
else
manual_subscriptions
.
add
(
data
+
1
,
size
-
1
,
pipe_
);
pending_pipes
.
push_back
(
pipe_
);
pending_data
.
push_back
(
blob_t
(
data
,
size
));
pending_metadata
.
push_back
(
sub
.
metadata
());
...
...
@@ -191,10 +197,19 @@ int zmq::xpub_t::xsetsockopt (int option_, const void *optval_,
void
zmq
::
xpub_t
::
xpipe_terminated
(
pipe_t
*
pipe_
)
{
// Remove the pipe from the trie. If there are topics that nobody
// is interested in anymore, send corresponding unsubscriptions
// upstream.
subscriptions
.
rm
(
pipe_
,
send_unsubscription
,
this
,
!
(
verbose_unsubs
||
manual
));
if
(
manual
)
{
// Remove the pipe from the trie and send corresponding manual
// unsubscriptions upstream.
manual_subscriptions
.
rm
(
pipe_
,
send_unsubscription
,
this
,
false
);
}
else
{
// Remove the pipe from the trie. If there are topics that nobody
// is interested in anymore, send corresponding unsubscriptions
// upstream.
subscriptions
.
rm
(
pipe_
,
send_unsubscription
,
this
,
!
verbose_unsubs
);
}
dist
.
pipe_terminated
(
pipe_
);
}
...
...
src/xpub.hpp
View file @
baea4066
...
...
@@ -79,6 +79,9 @@ namespace zmq
// List of all subscriptions mapped to corresponding pipes.
mtrie_t
subscriptions
;
// List of manual subscriptions mapped to corresponding pipes.
mtrie_t
manual_subscriptions
;
// Distributor of messages holding the list of outbound pipes.
dist_t
dist
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment