Message Exchange Over Web Sockets 🐈
This crate implements the simple pattern needed for implementing service-to-service message exchange over WebSocket connections. Users of meows can handle typed JSON message with the option for a default handler for any un-typed messages.
Meows is built on top of link:https://github.com/stjepang/smol[smol] for async websocket handling behavior. This makes Meows compatible with other smol-based applications, including those using link:https://github.com/async-rs/async-std[async-std] 1.6.0 or later.
All messages intended to be handled must be wrapped in a meows appropriate envelope described below:
Which will then be mapped to a struct such as:
In essence, anything that serde can deserialize, can be passed through meows.
Example
There are examples in the examples/
directory, here's a simple message handler:
use *;
use *;
use smol;
async
Contributing
Meows is a typical Rust project, e.g. cargo build
and cargo test
will do
most everything you would need to do.
There aren't nearly enough tests, helping with that would certainly be appreciated :)
Licensing
This crate is licensed as GPL-3.0+, which roughly means that if you're packaging up Meows and distributing a binary to an end-user, you must also make the source of the Meows code available to that end-user. It is intentionally not AGPL licensed, which means if you incorporate Meows into server-side code that is never distributed to end-users, then you do not need to make the code available to the service's users.