FWS Actors
FWS Actors
X | Twitch | Youtube | Mastodon | GitHub | GitHub Sponsors
fastwebsockets clients and servers in actors.
FWS Actors puts spit fastwebsockets streams into actors that handle the reading and writing of websocket frames. All you need to do is handle the creation of websocket connections and keep the WebSocketActors output channel from filling up.
Examples:
See tests for usage examples.
Known Issues:
- In testing I found that an excess close frame is sent from the server when testing in release mode. This is does not happen in the debug tests causing them to fail. Further testing needs to be done including trial implementations. Testing without the with_axum and unstable-split fastwebsockets features activated may be needed to find the cause.
Todo:
-
Clean up the code.
-
Add more documentation.
-
Make the unstable-split fastwebsockets feature optional. And with_axum too probably.
-
Add ways to get OwnedFrames from a cache and then have them added to this cache when you or the WebSocketActor are done with them.
-
Move ConnectionStateId and ConnectionStateMessage to the Highly Sendable crate.
-
Investigate adding Serde support to the actor message enums and add it where possible.
Coding Style
This project uses a coding style that emphasises the use of white space over keeping the line and column counts as low as possible.
So this:
fn bar() {}
fn foo()
{
bar();
}
Not this:
fn bar() {}
fn foo()
{
bar();
}
License
Licensed under either of:
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0 (see also: https://www.tldrlegal.com/license/apache-license-2-0-apache-2-0))
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT (see also: https://www.tldrlegal.com/license/mit-license))
at your discretion
Contributing
Please clone the repository and create an issue explaining what feature or features you'd like to add or bug or bugs you'd like to fix and perhaps how you intend to implement these additions or fixes. Try to include details though it doesn't need to be exhaustive and we'll take it from there (dependant on availability).
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.