starlane-space 0.3.19

The 'Space' portion of starlane as opposed to hyperspace. This is where 3rd parties customize Starlane's behavior with WebAssembly and external executables. To develop a starlane driver please look in `./starlane` which holds the 'hyperspace' code (which provides infrastructure)"
Documentation
pub fn state_relay<S>(
    initial: S,
) -> (
    tokio::sync::mpsc::Sender<S>,
    tokio::sync::watch::Receiver<S>,
)
where
    S: Clone + Send + Sync + 'static,
{
    let (mpsc_tx, mut mpsc_rx) = tokio::sync::mpsc::channel(8);
    let (watch_tx, watch_rx) = tokio::sync::watch::channel(initial);

    tokio::task::spawn(async move {
        while let Some(state) = mpsc_rx.recv().await {
            match watch_tx.send(state) {
                Err(err) => {}
                _ => {}
            }
        }
    });

    (mpsc_tx, watch_rx)
}