All Projects → cloudhead → Popol

cloudhead / Popol

Licence: mit
Minimal non-blocking I/O for Rust

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Popol

Ntex
framework for composable networking services
Stars: ✭ 381 (+222.88%)
Mutual labels:  async, networking
Flatend
Quickly build microservices using p2p networking in NodeJS/Go.
Stars: ✭ 600 (+408.47%)
Mutual labels:  networking, p2p
Trio
Trio – a friendly Python library for async concurrency and I/O
Stars: ✭ 4,404 (+3632.2%)
Mutual labels:  async, networking
P2p Graph
Real-time P2P network visualization with D3
Stars: ✭ 245 (+107.63%)
Mutual labels:  networking, p2p
P2p
P2P Cloud project allows users to build their private networks.
Stars: ✭ 116 (-1.69%)
Mutual labels:  networking, p2p
Lightio
LightIO is a userland implemented green thread library for ruby
Stars: ✭ 165 (+39.83%)
Mutual labels:  async, networking
Actix Net
A collection of lower-level libraries for composable network services.
Stars: ✭ 415 (+251.69%)
Mutual labels:  async, networking
P
Peer-to-peer networking with browsers
Stars: ✭ 400 (+238.98%)
Mutual labels:  networking, p2p
Ipfsfb
InterPlanetary File System for Business (IPFSfB) is an enterprise blockchain storage network based on InterPlanetary File System.
Stars: ✭ 57 (-51.69%)
Mutual labels:  networking, p2p
Vibe.d
Official vibe.d development
Stars: ✭ 1,043 (+783.9%)
Mutual labels:  async, networking
Spitfire
An easy to use WebRTC Datachannels library for .NET applications.
Stars: ✭ 164 (+38.98%)
Mutual labels:  networking, p2p
Tanya
GC-free, high-performance D library: Containers, networking, metaprogramming, memory management, utilities
Stars: ✭ 70 (-40.68%)
Mutual labels:  async, networking
Py Ipv8
Python implementation of the IPv8 layer
Stars: ✭ 157 (+33.05%)
Mutual labels:  networking, p2p
Smol
A small and fast async runtime for Rust
Stars: ✭ 2,206 (+1769.49%)
Mutual labels:  async, networking
Uvloop
Ultra fast asyncio event loop.
Stars: ✭ 8,246 (+6888.14%)
Mutual labels:  async, networking
Avenue
Wrapper around URLSession and URLSessionTask to enable seamless integration with Operation / OperationQueue.
Stars: ✭ 58 (-50.85%)
Mutual labels:  async, networking
Ws Machine
WS-Machine is a websocket finite state machine for client websocket connections (Go)
Stars: ✭ 110 (-6.78%)
Mutual labels:  async, networking
Drone
CLI utility for Drone, an Embedded Operating System.
Stars: ✭ 114 (-3.39%)
Mutual labels:  async
Handpose Facemesh Demos
🎥🤟 8 minimalistic templates for tfjs mediapipe handpose and facemesh
Stars: ✭ 116 (-1.69%)
Mutual labels:  networking
Madelineproto
Async PHP client/server API for the telegram MTProto protocol
Stars: ✭ 1,776 (+1405.08%)
Mutual labels:  async

popol

Minimal non-blocking I/O for Rust.

See examples/ folder for usage.

Overview

Async I/O in Rust is still an unsolved problem. With the stabilization of async/await, we are seeing a number of libraries and runtimes crop up, such as async-std and smol, while others such as tokio and mio are maturing. The problem with async/await is that you can't use any of the standard library traits, such as Read and Write. The async ecosystem comes with an entirely separate suite of traits (eg. AsyncRead and AsyncWrite) and I/O libraries. Furthermore, most of these runtimes have a large dependency footprint, partly from having to provide async alternatives to the standard library functions, and partly due to the complexity of these runtimes.

What do we need? For most use-cases, the ability to handle between a dozen and up to a few hundred open connections without blocking, is all we need. This places us squarely within the territory of the venerable poll() function, which is available on almost all platforms.

Popol is designed as a minimal ergonomic wrapper around poll(), built for peer-to-peer networking.

By building on poll, we have the following advantages:

  • Much smaller implementation than even the smallest async/await runtimes
  • All of the Rust standard library just works (io::Read, io::Write, etc.)
  • Virtually zero-dependency (the libc crate is the only dependency)
  • No "runtime". Keeps the code much easier to reason about

Why not use epoll? A couple of reasons:

  1. It is more complex than poll and requires us to write more code
  2. It isn't portable (only works on Linux)
  3. poll is sufficient for handling most workloads

Compared to mio, popol is:

  • A lot smaller (about 10% of the size)
  • A little more flexible and easy to use
  • Supports standard library sockets
  • Currently focused on unix-based system compatibility

Some of the advantages of popol's API over mio's:

  • popol supports multiple wakers per wait call.
  • popol event source identifiers are not limited to u64.
  • popol's API is composed mostly of infallible functions.

On the other hand, mio is more mature and probably better at handling very large number of connections. Mio also currently supports more platforms.

License

This software is licensed under the MIT license. See the LICENSE file for details.

About

(c) Alexis Sellier https://cloudhead.io

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].