Skip to main content

Module websocket_std

Module websocket_std 

Source
Expand description

WebSocket transport implementations.

This module provides WebSocket-based implementations of the FEAGI networking traits using the tungstenite crate with non-blocking sockets. All operations use set_nonblocking(true) and check for WouldBlock, making them compatible with any async runtime or synchronous usage.

§Socket Patterns

§Creating Instances

All server and client instances are created through their Properties types:

// Server example
let props = FeagiWebSocketServerPublisherProperties::new("127.0.0.1:8080")?;
let mut server = props.as_boxed_server_publisher();

// Client example
let props = FeagiWebSocketClientSubscriberProperties::new("ws://localhost:8080")?;
let mut client = props.as_boxed_client_subscriber();

Structs§

FeagiWebSocketClientPusher
A WebSocket client that pushes data to a server.
FeagiWebSocketClientPusherProperties
Configuration properties for creating a WebSocket pusher client.
FeagiWebSocketClientRequester
A WebSocket client that sends requests and receives responses.
FeagiWebSocketClientRequesterProperties
Configuration properties for creating a WebSocket requester client.
FeagiWebSocketClientSubscriber
A WebSocket client that subscribes to data from a publisher server.
FeagiWebSocketClientSubscriberProperties
Configuration properties for creating a WebSocket subscriber client.
FeagiWebSocketServerPublisher
A WebSocket server that broadcasts data to all connected clients.
FeagiWebSocketServerPublisherProperties
Configuration properties for creating a WebSocket publisher server.
FeagiWebSocketServerPuller
A WebSocket server that receives pushed data from clients.
FeagiWebSocketServerPullerProperties
Configuration properties for creating a WebSocket puller server.
FeagiWebSocketServerRouter
A WebSocket server that handles request-response communication with multiple clients.
FeagiWebSocketServerRouterProperties
Configuration properties for creating a WebSocket router server.