pub fn init_stream(config: EventStreamConfig, event_core: EventCore) -> Result<()> {
    // call_once can't return a Result (or anything), so we'll fake it
    // by hanging onto any error we might receive.
    let mut return_value: Result<()> = Ok(());

    INIT.call_once(|| {
            let conn_info =
                EventConnectionInfo::new(config.token, config.url, &event_core.supervisor_id);
            match stream_impl::init_stream(conn_info) {
                Ok(event_stream) => {
                    EVENT_STREAM.set(event_stream);
                    EVENT_CORE.set(event_core);
                }
                Err(e) => return_value = Err(e),
            }
        });

    return_value
}
/// Starts a new thread for sending events to a NATS Streaming
/// server. Stashes the handle to the stream, as well as the core
/// event information that will be a part of all events, in a global
/// static reference for access later.
Starts a new thread for sending events to a NATS Streaming
server. Stashes the handle to the stream, as well as the core
event information that will be a part of all events, in a global
static reference for access later.
Starts a new thread for sending events to a NATS Streaming server . Stashes the handle to the stream as well as the core event information that will be a part of all events in a global static reference for access later .
pub fn init_stream(config: EventStreamConfig, event_core: EventCore) -> Result<()> {
    // call_once can't return a Result (or anything), so we'll fake it
    // by hanging onto any error we might receive.
    let mut return_value: Result<()> = Ok(());
    INIT.call_once(|| {
            let conn_info =
                EventConnectionInfo::new(config.token, config.url, &event_core.supervisor_id);
            match stream_impl::init_stream(conn_info) {
                Ok(event_stream) => {
                    EVENT_STREAM.set(event_stream);
                    EVENT_CORE.set(event_core);
                }
                Err(e) => return_value = Err(e),
            }
        });
    return_value
}
pub fn init_stream ( config : EventStreamConfig , event_core : EventCore ) -> Result < ( ) > { // call_once can't return a Result (or anything), so we'll fake it // by hanging onto any error we might receive. let mut return_value : Result < ( ) > = Ok ( ( ) ) ; INIT . call_once ( | | { let conn_info = EventConnectionInfo :: new ( config . token , config . url , & event_core . supervisor_id ) ; match stream_impl :: init_stream ( conn_info ) { Ok ( event_stream ) => { EVENT_STREAM . set ( event_stream ) ; EVENT_CORE . set ( event_core ) ; } Err ( e ) => return_value = Err ( e ) , } } ) ; return_value }
Starts a new thread for sending events to a NATS Streaming
server.
Starts a new thread for sending events to a NATS Streaming server .
config
EventStreamConfig
event_core
EventCore
config
EventStreamConfig
event_core
EventCore