Crates.io | workflow-websocket |
lib.rs | workflow-websocket |
version | 0.18.0 |
source | src |
created_at | 2022-08-22 10:54:38.284666 |
updated_at | 2024-09-07 16:57:10.447148 |
description | WebSocket crate (client and server) providing an async Rust API that functions uniformly in native and in browser (WASM32) environments. This crate allows you to develop WebSocket-driven data exchange that function uniformly in web and desktop applications. |
homepage | |
repository | https://github.com/workflow-rs/workflow-rs |
max_upload_size | |
id | 650298 |
size | 117,376 |
workflow-websocket
Part of the workflow-rs
application framework.
Platform-neutral WebSocket Client and native Server.
WebSocket
class) as well as on native platforms (backed by Tungstenite client).This crate allows you to develop a WebSocket client that will work uniformly in in hte native environment and in-browser.
Workflow-WebSocket crate is currently (as of Q3 2022) one of the few available async Rust client-side in-browser WebSocket implementations.
This web socket crate offers an async message send API as well as provides access to Receiver and Sender async_std channels ([async_channel])(https://docs.rs/async-channel/latest/async_channel/) that can be used to send and receive WebSocket messages asynchronously.
To use workflow-websocket
in the Node.js environment, you need to introduce a W3C WebSocket object before loading the WASM32 library
to simulate the global WebSocket
object available in Web Browsers.
The WebSocket NPM module provides W3C WebSocket compatible implementation and can
be used as follows:
// WebSocket
globalThis.WebSocket = require('websocket').w3cwebsocket;
// Load WASM32 library ...