Git Product home page Git Product logo

asgiref's Introduction

asgiref

Contains various reference ASGI implementations, including:

  • A base channel layer, asgiref.base_layer
  • An in-memory channel layer, asgiref.inmemory
  • WSGI-to-ASGI and ASGI-to-WSGI adapters, in asgiref.wsgi

Base Channel Layer

Provides an optional template to start ASGI channel layers from with the two exceptions you need provided and all API functions stubbed out.

Also comes with logic for doing per-channel capacities using channel names and globbing; use self.get_capacity and pass the arguments through to the base __init__ if you want to use it.

In-memory Channel Layer

Simply instantiate asgiref.inmemory.ChannelLayer, or use the pre-made asgiref.inmemory.channel_layer for easy use. Implements the group extension, and is designed to support running multiple ASGI programs in separate threads within one process (the channel layer is threadsafe).

WSGI-ASGI Adapters

These are not yet complete and should not be used.

Benchmarker

To use the benchmarker, once asgiref is installed, run the asgiref_benchmark program with the path to a channel layer instance (and an optional number of messages to test) to get throughput statistics:

$ asgiref_benchmark -n 2000 myproject.asgi:channel_layer
...
Received: 2000/2000 (100.0%)
Latency mean: 0.0011  median: 0.0010  10%: 0.0008  90%: 0.0014
Send throughput: 1146.0/s
Receive throughput: 1146.0/s

Dependencies

All Channels projects currently support Python 2.7, 3.4 and 3.5.

Contributing

Please refer to the main Channels contributing docs. That also contains advice on how to set up the development environment and run the tests.

Maintenance and Security

To report security issues, please contact [email protected]. For GPG signatures and more security process information, see https://docs.djangoproject.com/en/dev/internals/security/.

To report bugs or request new features, please open a new GitHub issue.

This repository is part of the Channels project. For the shepherd and maintenance team, please see the main Channels readme.

asgiref's People

Contributors

andrewgodwin avatar maiksprenger avatar navyad avatar ostcar avatar patchwork-systems avatar proofit404 avatar rixx avatar vartec avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.