Running local or remote python servers in the background and establish stream socket-based communication with clients.
Project description
Running local or remote python servers in the background using Popen
from the
subprocess module and establish stream socket-based communication with clients
in both directions.
Getting started
Get the stable release of the package from pypi:
pip install bgpy
Run an example background process on localhost and communicate using stream sockets:
from bgpy.interface import initialize, execute, terminate
from bgpy.example.tasks import init_task, exec_task, exit_task
# Start background process
initialize(init_task, exec_task, exit_task)
# Increase value
execute({"command": "increase", "value_change": 10})
# Decrease value
execute({"command": "decrease", "value_change": 100})
# Terminate
args = terminate(await_response=True)
License
This project is licensed under the MIT License - see the LICENSE file for details
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bgpy-0.1.0.tar.gz
(9.3 kB
view hashes)
Built Distribution
bgpy-0.1.0-py3-none-any.whl
(11.4 kB
view hashes)