You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I understand motivations behind this, but since one crucial use case for web applications is sending request and getting response back, it will be tempting for us to make our backends an actors too.
But since actors model is designed to be fire and forget, because sending messages are not blocking like in continuation or CSP or Saga. For example sending a form would look like send a request to backend and forget about it, at some point backend will send message with error or success status. Which will look like communicating over websockets, then some correlation identifier needs to be sent to identify message when it gets back, so this is the one of the bad examples how actor model could be used, re implementing http requests over http.
Cleaner approach In my opinion would be to create actor that listens for messages that trigger requests and when promise resolves actor will send update message to state actor. much like how redux-saga is used. Service worker can be a good place for this actor
The text was updated successfully, but these errors were encountered:
I understand motivations behind this, but since one crucial use case for web applications is sending request and getting response back, it will be tempting for us to make our backends an actors too.
But since actors model is designed to be fire and forget, because sending messages are not blocking like in continuation or CSP or Saga. For example sending a form would look like send a request to backend and forget about it, at some point backend will send message with error or success status. Which will look like communicating over websockets, then some correlation identifier needs to be sent to identify message when it gets back, so this is the one of the bad examples how actor model could be used, re implementing http requests over http.
Cleaner approach In my opinion would be to create actor that listens for messages that trigger requests and when promise resolves actor will send update message to state actor. much like how redux-saga is used. Service worker can be a good place for this actor
The text was updated successfully, but these errors were encountered: