Zephserver is a python service manager that can be used in a cluster. It has been written to support a websocket server but it can be used for any other stuff needing full time services or cluster management.
More documentation on how the server works here
To use zephserver you will need python 2.7. It should not work on python 3 and a Unix incompatible system.
(use zephserver as a websocket server bellow)
pip install zephserver
mkdir myserver
take zephsettings.py file from the example folder.
the variable heart_beat_period, PORT_ZEPH and TASKS_PATH are not used
empty the service list(these services are made for the websocket server)
Copy zephstarter_no_django.py file in your folder
read the zephserver/service/service_interface.py file to know the minimum interface you have to implement.
Add your service to the SERVICE_LIST variable.
Respect the syntax my_server.my_package.my_service/MyService
syntaxe.
example for the service_interface it would be 'zephserver.service.service_interface/ServiceInterface'
nota : there is no need for the service object to have the same name as its file and there can be multiple services in a file.
To start your server in the current shell, simply call : python zephstarter_no_django.py
.
tips: to not lock your shell user the &
modifier at the end of the command.
to stop your server call zephserver-stop /path/to/the/folder/interface.sock
If the server died without the zephserver command (crash) you will have to remove the server.lock file.
pip install zephserver
If you wants to use django services (db_service and session backend with django) install django(only version 1.7 is supported)
mkdir myserver
if you use django myserver will simply refer to the django site folder
take zephsettings.py file from the example folder.
If you use django Copy the zephstarter.py file and adpt it to your application otherwise copy zephstarter_no_django.py file in your folder
To start your server in the current shell, simply call : python zephstarter.py
.
tips: to not lock your shell user the &
modifier at the end of the command.
to stop your server call zephserver-stop /path/to/the/folder/interface.sock
If the server died without the zephserver command (crash) you will have to remove the server.lock file.