Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/synodriver/landnet

actor for python
https://github.com/synodriver/landnet

Last synced: 11 days ago
JSON representation

actor for python

Awesome Lists containing this project

README

        

# landnet
- inspired by skynet, the actor style concurrency

### public api
```python
from typing import Any, Dict, Optional, Union, Callable, Awaitable, TypeVar
T = TypeVar('T')
Handler_T = Union[Callable[..., Awaitable[T]], Callable[..., T]]

class Service:
name: Any
kwargs: Any
def __init__(self, name, *, handler: Handler_T = ..., on_startup: Handler_T = ..., on_shutdown: Handler_T = ..., max_size: int = ..., **kwargs) -> None: ...
def handle(self): ...
def on_startup(self): ...
def on_shutdown(self): ...
def put_msg(self, msg) -> None: ...
async def startup(self) -> None: ...
async def shutdown(self) -> None: ...

def get_service(name: str) -> Optional[Service]: ...
def list_services() -> Dict[str, Service]: ...
def send(name: Union[Service, str], *args, **kwargs) -> None: ...
async def call(name: Union[Service, str], *args, **kwargs): ...
def reply(uuid: int, msg: Any, err: Any = ...) -> None: ...
```