polymerlabs / actor-boilerplate Goto Github PK
View Code? Open in Web Editor NEWA starting point for web apps based on the actor model.
License: BSD 3-Clause "New" or "Revised" License
A starting point for web apps based on the actor model.
License: BSD 3-Clause "New" or "Revised" License
I was trying out the "Todo note-taking app" example and was wondering about the unreliable behavior:
Sometimes todos didn't appear and a refresh led to a blank screen (see https://twitter.com/bwaidelich/status/1227653864423292929)
It turns out I had the app open in multiple browser tabs and the web worker decided to talk the the other instance.. Sometimes.. very entertaining but also quite confusing stuff :)
Many presentations from recent Google I/O focused on sophisticated code splitting and lazy loading. Could you include examples how to do it in actors which could run in web workers?
For example based on some message specific state reducer could get loaded, or some REST service API component would get loaded only when it needs to use some specific part of that API.
Can we use this model in 2021, or else do we have any better model than this?
I kind of like this model, but never tried. I want to give it a shot.
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
Could you possibly include some example tests showing best practices of testing actor based applications? For example hooking up a mock instead of an actor to test if sending specific message to one actor results in another actor receiving expected message as well. The whole asynchronous messaging between actors doesn't seem obvious to test.
https://github.com/PolymerLabs/actor-boilerplate/blob/master/src/bootstrap.ts#L25
Got an issue or PR that explains why this is needed?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.