Skip to content

Subscription and Publish in a multi-threaded ws server... #1050

Answered by ghost
vidcentum asked this question in Q&A
Discussion options

You must be logged in to vote

This should be added to the user manual under Scaling up,

Every thread has its own Loop, and uWS::Loop::get() returns the Loop for current thread.

Loop::defer(function) is the only thread-safe function here; you use it to defer the calling of a function to the thread that runs the Loop. Use this to signal every Loop that it should publish some message.

Replies: 10 comments 7 replies

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@mfallavol
Comment options

@mfallavol
Comment options

@vidcentum
Comment options

@vidcentum
Comment options

@mfallavol
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1050 on December 09, 2020 02:28.