Something went wrong. Try again.
A Crossbeam backend for Bevy Replicon
Something went wrong. Try again.
Files
- Rust 100%
README.md
Bevy Replicon Crossbeam Backend #
A Crossbeam Backend for bevy_replicon. Greatly inspired by the backend example.
It allows communication locally with a replicon server running in a separate thread from the client, using crossbeam channels.
Warning
Experimental and has not yet been thoroughly tested. PRs welcome.
Usage #
// Create the transport and a connector to hand to the client side.
// The transport must be given to the server app before it starts.
let transport = CrossbeamServerTransport::new();
let connector = transport.connector();
server_app.insert_resource(transport);
thread::spawn(move || server_app.run());
client_app.insert_resource(connector);
// Inside a system, we call `connect()` to create a paired channel and
// register the client with the server.
// Insert the returned `RepliconCrossbeamClient` Resource so the client plugin can use it.
let crossbeam_client = connector.connect();
commands.insert_resource(crossbeam_client);
You can also check the "simple_button" example with cargo run --example simple_button.
License #
Licensed under either of Apache License, Version 2.0 or MIT License at your option.