Available pynng usage examples
masterThe examples/ directory provides implementations of various NNG communication patterns using pynng. These examples serve as templates for different messaging topologies:
- Pair (Two-Way Radio): Bi-directional connection between two endpoints (
pair0.py). - Polyamorous Pair: Multiple connections using the pair pattern, including async implementations for
trio(pair1_async.py) andcurio(pair1_async_curio.py). - Pipeline (One-Way Pipe): Push/Pull pattern for unidirectional data flow (
pipeline.py). - Request/Reply (I ask, you answer): Rep0/Req0 pattern for synchronous-style request/response cycles (
reqprep.py). - Pub/Sub (Topics & Broadcast): Pub0/Sub0 pattern for broadcasting messages to multiple subscribers (
pubsub.py). - Survey (Everybody Votes): Surveyor0/Respondent0 pattern for collecting responses from multiple participants (
survey.py). - Bus (Routing): Bus0 pattern for complex routing and many-to-many communication (
bus.py).