an implementation of the multistream protocol in python
Project description
py-multistream-select
an implementation of the multistream protocol in python
Table of Contents
Install
py-multistream-select
is a standard PyPI module which can be installed with:
pip install multistream-select
Usage
Example
from multistream_select.multiselect import Multiselect
from multistream_select.multiselect_client import MultiselectClient
async def client_get_protocol(host_info):
protocols = [ '/cats', '/dogs' ]
stream = func_to_create_stream(host_info)
client = MultiselectClient()
return await client.select_one_of(protocols, stream)
async def host_get_protocol(handlers):
stream = func_to_create_stream()
host = Multiselect()
for protocol in handlers:
host.add_handler(protocol, handlers[protocol])
return host.negotiate(stream)
Contribute
Contributions welcome. Please check out the issues.
Check out our contributing document for more information on how we work, and about contributing in general. Please be aware that all interactions related to multiformats are subject to the IPFS Code of Conduct.
Small note: If editing the README, please conform to the standard-readme specification.
License
This project is licensed under the MIT License - see the LICENSE file for details
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file multistream_select-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: multistream_select-0.1.3-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c306e5d9c975000d699f44102429b99fe990423628e410a78d87d2c57fd5ac18 |
|
MD5 | f51488b1dba1a3dc5140a633d342d1f9 |
|
BLAKE2b-256 | 5695d64936cb6470c90b74dfad6995d96e0725eae2c1cafe57532d5f0f547a0a |