A managed runtime aimed at running games distributed over multiple nodes
Project description
Epic Server
EpicMan Server is a SANS-IO Async application server that runs your code over multiple 'Nodes'. This has the added effect of not being limited to a single core for running your code and mitigating some of the effects of the GIL in the cpython (and others) implementation
While this is an Async Server this is NOT AsyncIO compatible and brings its own abstractions for File, Network and locking in order to meet the latency requirements imposed by its primary use case (Game engine that runs atop this framework)
*** NOTE: this is a Technology preview/Alpha release ***
Only a single instance is likley to work at this time or 2 node clusters with caveats
Internal and External APIs are in heavy flux
Features
- Pluggable IO engines
- Automatic Persistence of game features
- Transparent Inter-process messaging abstraction
- python3 codebase
- Uses async/await (but is not AsyncIO compatible)
- pypy3 compatible for versions supporting the python3.8 spec
Getting Started
The Full documentation is available here. The examples below should give you a quick feel for management of a cluster and what programming for epic server looks like.
Requirements
- Python 3.6 or newer
- Linux 5.x or newer (io_uring)
- liburing-dev (debian)
- liburing1 (debian)
- 64bit CPU if using lmdb backend
- Kernel headers may be required to compile the python io_uring module
Examples
Starting a single or multiple node cluster is relatively simple as shown below. All that is required is a simple script to bootstrap the Initial Entities. In this example we use a simple test script called 'cluster.py' that is looked up on PYTHONPATH. if using a script in your current directory then prepending PYTHONPATH=. to the epic-server commands will ensure that this script can be found correctly.
$ python3 -m venv venv
$ venv/bin/pip install epicman-server
$ venv/bin/epic-server -vvv -l '[::1]:3030'
$ venv/bin/epic-server-start -vvv -b '[::1]:3030' cluster:start
Programming for epicman.server
The following is taken from 'cluster:start' from the above example and simply sends a value, has it incremented then passes the incremented value on to the next entity to confirm that the RPC like interface works
from epicman.objects import EntityProxy, Entity, remote_spawn, remote_call
from epicman.syscalls import THREAD_SLEEP
from epicman.logging import log
import sys
TOTAL_COUNT = 1000
class _Test(Entity):
@remote_call
async def test(self, val):
return val + 1
# this is a temporary work around pickle limitations and
# issues pickle has with things that are renamed
Test = EntityProxy(_Test)
async def start():
count = 0
for i in range(TOTAL_COUNT):
count = await Test[i].test(count)
log.info('Value: {count}', count=count)
sys.exit()
Stay up to date
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
Built Distribution
File details
Details for the file epicserver-0.2.8.tar.gz
.
File metadata
- Download URL: epicserver-0.2.8.tar.gz
- Upload date:
- Size: 190.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 697063eb269aae01ee9240f546651aed5ebc67ea16efcffbd2e539e951bdd745 |
|
MD5 | c8e8017cda0f748ea84321a7123bf503 |
|
BLAKE2b-256 | 5aaa7d3ebe2031eb106cdc55220504c3193710cb59fcec768ec0c35fde663c0d |
File details
Details for the file epicserver-0.2.8-py3-none-any.whl
.
File metadata
- Download URL: epicserver-0.2.8-py3-none-any.whl
- Upload date:
- Size: 78.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6bd021a28319456615249e6841320be57fa40faced735df00e3a6f319bdc83bd |
|
MD5 | 58414982a3dd0b9a66315ed6aa2a6484 |
|
BLAKE2b-256 | cd58c481b5bf24e9a37f6eff84b999c534ff8c54247c6dba318a1f70853919b6 |