semvec/pypi-packages huggingface dataset:
simple-asgi 0.0.2
Simple ASGI HTTP 1.1 web server

# Simple ASGI HTTP 1.1 server implementation

This framework was inspired by [hypercorn](https://pgjones.gitlab.io/hypercorn/index.html) framework.

## How to install

```bash
pip install simple-asgi
```

## Example

```python
import os
import socket


from simple_asgi import app
from simple_asgi import response
from simple_asgi import router


async def hello(request):
    request_body = await request.data
    return response.Response(body=request_body)

sock_path = "/tmp/fn.sock"
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)

try:
    os.remove(sock_path)
finally:
    sock.bind("/tmp/fn.sock")

rtr = router.Router()
rtr.add("/call", ["POST"], hello)
http_app = app.SimpleASGI(name=__name__, router=rtr)

http_app.run(sock=sock)

```
pipe-nonblock 0.4
Non-blocking multiprocessing pipe

# pipe-nonblock [![Build Status](https://travis-ci.org/maxtwen/Non-Blocking-Multiprocessing-Pipe.svg?branch=master)](https://travis-ci.org/maxtwen/Non-Blocking-Multiprocessing-Pipe)
Non-blocking multiprocessing pipe

## Installing

```bash
pip install pipe_nonblock
```

## Supported versions

- Python 3.4+

## Usage
```python3
from pipe_nonblock import Pipe

c1, c2 = Pipe(duplex=True, conn1_nonblock=True, conn2_nonblock=True) # create a new duplex non-blocking pipe
assert len(list(c2.recv(32))) == 0                                   # try receive data from a connection, it's empty at the moment 
c1.send('foo')                                                       # send python string object
buf, = c2.recv(32)                                                   # recv return generator with received objects
assert buf == 'foo'
c2.send('bar')
buf, = c1.recv(32)
assert buf == 'bar'
```

## Overview of Pipe function

```python
def Pipe(duplex, conn1_nonblock, conn1_nonblock) -> Tuple[connection1, connection2]:
```

| parameter  |type   | description  |
|---|---|---|
| duplex  | bool  | If duplex is True (the default) then the pipe is bidirectional. If duplex is False then the pipe is unidirectional: conn1 can only be used for receiving messages and conn2 can only be used for sending messages.  |
| conn1_nonblock  | bool  | If conn1_nonblock is True then the connection1 is  non-blocking  |
| conn2_nonblock  |bool   |  If conn2_nonblock is True then the connection2 is  non-blocking |