Skip to content

Can client class provide DelEvent method? #70

Closed Answered by daniele77
Crazyokd asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Crazyokd,

This library is designed for single-threaded use with asynchronous programming. Essentially, you have boost::io_context, which is a task queue where tasks are run in the thread that calls io_context::run()—usually the main thread.

With this in mind, the method Client::OnEvent should run in the same thread where the handlers are executed, i.e., the thread running io_context::run().

This shouldn't be a problem. Since the application is event-based, if you want to dynamically add or remove an event handler (even though only removal is currently possible), you'll likely do so inside an event handler that runs in the io_context thread.

However, if you need to call the Client::OnE…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@daniele77
Comment options

@Crazyokd
Comment options

Answer selected by Crazyokd
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 #69 on July 12, 2024 08:44.