Reputation: 11
I am currently reading about reactive programming and the actor model.
What I am wondering is : when asynchronous events (or messages) are triggered, some procedures of the program react to it, meaning they are queued in the event loop. In the context of a node.js web server, what happens when the thread crashes in the meantime (due to the handling of another request which throws)?
My understanding is that the elements in the event loop are lost. In this case, the preceding reactive workflows are stopped in the middle. But that would contradict with the fact that reactive programming, and/or the actor model, are seen as fault-tolerant and highly available systems.
Am I correct? I must be missing / not understanding something.
Thank you in advance for your help!
Upvotes: 0
Views: 32
Reputation: 166
As I know, the elements should be handled / destroyed based on your policy. Even if you thread crash, you shouldn't left them unhandled. You should handle any errors and your application should be available to recreate any thread that breaks of unexpected errors. Also, on crash you should put your message on handle by any free thread again.
Upvotes: 0