| Crates.io | links_bindings_python |
| lib.rs | links_bindings_python |
| version | 0.2.12 |
| created_at | 2024-01-17 02:06:24.092295+00 |
| updated_at | 2024-02-24 00:38:06.671355+00 |
| description | Python bindings for the links_connect_nonblocking library |
| homepage | |
| repository | https://github.com/softstream-link/links |
| max_upload_size | |
| id | 1102357 |
| size | 61,169 |
Traditionally, network api provide methods that exposes access to very low level byte arrays of data where as an application layer prefers to work with structs which carry information about application state.
Rust's std::net module is not an exception and it leaves developer with the responsibility to interpret the byte array by performing a number of steps to extract a single frame of bytes from that array, convert it into a desired data structure, while keeping track of remaining bytes and managing a lot of other details. The implementation details here have direct impact on application performance and reliability.
Even once those details have been addressed, the developer has to solve for many additional tasks such as:
This library addresses above challenges, while providing a highly performant network code without imposing limitations on how application wishes to use the api.
At a very high level The main concept is based on the the following two structures
Clt - this is a network client and can initiate a connectionSvc - this is a network service which listens to a port and creates a Clt for each established connectionClt and Svc then provide and send and recv methods with a signature that roughly looks like this:
Clt::send(msg: &T) vs Clt::recv() -> T - where T is a generic type that you specify when instantiating a Clt and SvcThere are three implementations of this library. Follow individual links for more details
send()/recv() methods take a timeout argument. This allows the application developer to set io wait limits. The internal implementation relies on spin locks and waits to provide best latency performance as it does not let OS to park the running thread, which incurs significant latency penalty. This implementation is recommended for cases with low latency performance requirement.async/await tokio framework, however, at the moment of this writing Rust's async api is still going through stabilization and is not yet available on stable toolchain.