Skip to content

A POC echo server using Tornado websockets and Python3/Rust interop via CFFI (through Milksnake)

Notifications You must be signed in to change notification settings

mchlrhw/papyrus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Papyrus

A proof of concept echo server, used to demonstrate Python/Rust interop using websockets as the transport. The interop is achieved through CFFI and uses the Milksnake setup tool to generate Python extension modules and headers.

Manual testing

Create a virtual environment:

$ python3.6 -m venv venv
$ . venv/bin/activate
(venv) $

Install papryus:

(venv) $ pip install . -v --editable

Run papyrus:

(venv) python -m papyrus

Install the websocket-client package and spin up a Python interpreter in another terminal:

>>> from websocket import create_connection
>>> ws = create_connection("ws://localhost:8888/echo")
>>> ws.send("To Rust and back again!")
29
>>> ws.recv()
'To Rust and back again!'
>>> ws.close()

In the papyrus terminal you should see:

Websocket opened
Websocket closed

About

A POC echo server using Tornado websockets and Python3/Rust interop via CFFI (through Milksnake)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published