Skip to content

Can I run asynchronous actions sequentially in EventM? #462

Closed Answered by jtdaugherty
amano-kenji asked this question in Q&A
Discussion options

You must be logged in to vote

I wonder whether there is something like javascript promise API for EventM.

If you're wondering whether this is provided by Brick itself, then no, there is no such API. I would not recommend attempting to orchestrate something like that from EventM. I find it actually quite manageable to use a custom event approach and have a separate thread that accepts "requests" (e.g. over a TChan), does work, and then sends "responses" back to the main event loop in the form of custom app events. That is how Brick is intended to be used, although you could certainly implement your own async scheme; it would ultimately need to use custom application events anyway since that's the only way to trigger …

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by amano-kenji
Comment options

You must be logged in to vote
6 replies
@jtdaugherty
Comment options

@amano-kenji
Comment options

@jtdaugherty
Comment options

@jtdaugherty
Comment options

@jtdaugherty
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