Skip to content

Commit

Permalink
feat: pass a custom WebsocketConfig to connect for overriding default…
Browse files Browse the repository at this point in the history
… timeout
  • Loading branch information
mattyg committed Sep 5, 2024
1 parent a6c8b20 commit 91c4732
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/admin_websocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ impl AdminWebsocket {
/// As string `"localhost:30000"`
/// As tuple `([127.0.0.1], 30000)`
pub async fn connect(socket_addr: impl ToSocketAddrs) -> Result<Self> {
Self::connect_with_config(socket_addr, Arc::new(WebsocketConfig::CLIENT_DEFAULT))
}

/// Connect to a Conductor API AdminWebsocket with a custom WebsocketConfig.
pub async fn connect_with_config(socket_addr: impl ToSocketAddrs, config: Arc<WebsocketConfig>) -> Result<Self> {
let addr = socket_addr
.to_socket_addrs()?
.next()
Expand Down

0 comments on commit 91c4732

Please sign in to comment.