Skip to main content

an implementation of the multistream protocol in python

Project description

py-multistream-select

Travis CI codecov.io

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

This version
History Node

0.1.2

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
multistream_select-0.1.2-py3-none-any.whl (11.3 kB) Copy SHA256 hash SHA256 Wheel py3

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page