Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ install:
- pip install -U . -r requirements-test.txt

script:
- mypy tractor/ --ignore-missing-imports
- pytest tests/ --no-print-logs
1 change: 1 addition & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pytest
pytest-trio
pdbpp
mypy
21 changes: 14 additions & 7 deletions tractor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
``trio`` and ``multiprocessing``.
"""
from functools import partial
import typing

import trio
import trio # type: ignore

from .log import get_console_log, get_logger, get_loglevel
from ._ipc import _connect_chan, Channel
Expand Down Expand Up @@ -32,7 +33,13 @@
_default_arbiter_port = 1616


async def _main(async_fn, args, kwargs, name, arbiter_addr):
async def _main(
async_fn: typing.Callable[..., typing.Awaitable],
args: typing.Tuple,
kwargs: typing.Dict[str, typing.Any],
name: str,
arbiter_addr: typing.Tuple[str, int]
) -> typing.Any:
"""Async entry point for ``tractor``.
"""
log = get_logger('tractor')
Expand Down Expand Up @@ -73,11 +80,11 @@ async def _main(async_fn, args, kwargs, name, arbiter_addr):


def run(
async_fn,
*args,
name=None,
arbiter_addr=(_default_arbiter_host, _default_arbiter_port),
**kwargs
async_fn: typing.Callable[..., typing.Awaitable],
*args: typing.Tuple,
name: str = None,
arbiter_addr: typing.Tuple[str, int] = (_default_arbiter_host, _default_arbiter_port),
**kwargs: typing.Dict[str, typing.Any],
):
"""Run a trio-actor async function in process.

Expand Down
Loading