Skip to main content

connect

Function connect 

Source
pub async fn connect(
    jaconfig: JaConfig,
    api_interface: JanusAPI,
    transaction_generator: impl GenerateTransaction,
) -> Result<JaConnection, Error>
Expand description

Creates a new connection with janus server from the provided configs.

ยงExample:

let config = JaConfig::builder()
    .url("ws://localhost:8188/ws")
    .capacity(32)
    .build();
let mut connection = jarust_core::connect(config, ApiInterface::WebSocket, RandomTransactionGenerator).await.unwrap();