Just wanted to share a bit on progress of my small distributed actors showcase demo:
- Improved a bit error and crash handling (Let it crash™️) to self recover the service if something happens.
- Removed some stuff, like new swift foundation, for simplicity. And overall some parts of code look way better now.
- First of all, already posted in different topic, but now we can do simple event sourcing. You can think about event sourcing as autosaves in games—whatever bad happens you can jump to last saved state. The way it works is you just add plugin to the system, conform desired actors to
EventSourced
protocol and update the logic to handle events. - Added Swift openapi generator.
- Removed websockets. This is an interesting point, basically while moving to openapi @Honza_Dvorsky suggested that you can also remove ws and use streams. And this was suprising for me, as I've always thought that things like SSE works one way. But apparently you can do bidirectional streaming by initialising streams both way. Sounds obvious now, but
And as I think it's not quite discoverable—ended up creating a PR with an example. Thx again @Honza_Dvorsky and @beaumont for input and help.
After all the updates really like the state of the code now—quite simple, but you have fully working chat example with db, event sourcing, recovery and crash handling. Will try to improve it further, some still missing (like postgresql journal for event sourcing), but overall think next steps would be finally to play with infrastructure, like real device (raspberry) or VPS. This will include deploying, node discoverability and etc.
Hope there will be a nice demo soon, with documentation and tutorial.