Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example with back end communication #10

Open
askbeka opened this issue Nov 23, 2018 · 1 comment
Open

Example with back end communication #10

askbeka opened this issue Nov 23, 2018 · 1 comment

Comments

@askbeka
Copy link

askbeka commented Nov 23, 2018

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

@askbeka askbeka mentioned this issue Nov 23, 2018
@TimvdLippe
Copy link
Contributor

We are currently working on this and iterating ideas. Hopefully we can get back to you soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants