lunatic-solutions / lunatic

Lunatic is an Erlang-inspired runtime for WebAssembly
https://lunatic.solutions
Apache License 2.0
4.62k stars 138 forks source link

Distributed client server message passing refactor #135

Closed kosticmarin closed 1 year ago

kosticmarin commented 2 years ago

This PR refactors how the QUIC connections are handled between node clients and servers (same applies for control node).

Before each Connection would be stored in a DashMap, now each Connection is in its own task where we can easily manage failures and reconnect. The message API now just forwards Requests to each task with unbounded_channel. Further additional error handling between client and server is added in order to properly return error code in host functions.

There are still some open questions with the new architecture:

Next steps:

I've also run benchmark against this branch, no significant changes in performance. In fact the results across multiple runs seem more consistant.