move tractor._ipc.py into tractor.ipc._chan.py

Guillermo Rodriguez 2025-03-13 20:41:30 -03:00
parent ab1a60bc97
commit 9cbe294996
No known key found for this signature in database
GPG Key ID: 002CC5F1E6BDA53E
13 changed files with 24 additions and 13 deletions

View File

@ -62,6 +62,6 @@ from ._root import (
run_daemon as run_daemon, run_daemon as run_daemon,
open_root_actor as open_root_actor, open_root_actor as open_root_actor,
) )
from ._ipc import Channel as Channel from .ipc import Channel as Channel
from ._portal import Portal as Portal from ._portal import Portal as Portal
from ._runtime import Actor as Actor from ._runtime import Actor as Actor

View File

@ -85,7 +85,7 @@ from .msg import (
pretty_struct, pretty_struct,
_ops as msgops, _ops as msgops,
) )
from ._ipc import ( from .ipc import (
Channel, Channel,
) )
from ._streaming import ( from ._streaming import (
@ -101,7 +101,7 @@ from ._state import (
if TYPE_CHECKING: if TYPE_CHECKING:
from ._portal import Portal from ._portal import Portal
from ._runtime import Actor from ._runtime import Actor
from ._ipc import MsgTransport from .ipc import MsgTransport
from .devx._frame_stack import ( from .devx._frame_stack import (
CallerInfo, CallerInfo,
) )

View File

@ -29,7 +29,7 @@ from contextlib import asynccontextmanager as acm
from tractor.log import get_logger from tractor.log import get_logger
from .trionics import gather_contexts from .trionics import gather_contexts
from ._ipc import _connect_chan, Channel from .ipc import _connect_chan, Channel
from ._portal import ( from ._portal import (
Portal, Portal,
open_portal, open_portal,

View File

@ -64,7 +64,7 @@ if TYPE_CHECKING:
from ._context import Context from ._context import Context
from .log import StackLevelAdapter from .log import StackLevelAdapter
from ._stream import MsgStream from ._stream import MsgStream
from ._ipc import Channel from .ipc import Channel
log = get_logger('tractor') log = get_logger('tractor')

View File

@ -43,7 +43,7 @@ from .trionics import maybe_open_nursery
from ._state import ( from ._state import (
current_actor, current_actor,
) )
from ._ipc import Channel from .ipc import Channel
from .log import get_logger from .log import get_logger
from .msg import ( from .msg import (
# Error, # Error,

View File

@ -43,7 +43,7 @@ from .devx import _debug
from . import _spawn from . import _spawn
from . import _state from . import _state
from . import log from . import log
from ._ipc import _connect_chan from .ipc import _connect_chan
from ._exceptions import is_multi_cancelled from ._exceptions import is_multi_cancelled

View File

@ -42,7 +42,7 @@ from trio import (
TaskStatus, TaskStatus,
) )
from ._ipc import Channel from .ipc import Channel
from ._context import ( from ._context import (
Context, Context,
) )

View File

@ -73,7 +73,7 @@ from tractor.msg import (
pretty_struct, pretty_struct,
types as msgtypes, types as msgtypes,
) )
from ._ipc import Channel from .ipc import Channel
from ._context import ( from ._context import (
mk_context, mk_context,
Context, Context,

View File

@ -54,7 +54,7 @@ from tractor.msg import (
if TYPE_CHECKING: if TYPE_CHECKING:
from ._runtime import Actor from ._runtime import Actor
from ._context import Context from ._context import Context
from ._ipc import Channel from .ipc import Channel
log = get_logger(__name__) log = get_logger(__name__)

View File

@ -91,7 +91,7 @@ from tractor._state import (
if TYPE_CHECKING: if TYPE_CHECKING:
from trio.lowlevel import Task from trio.lowlevel import Task
from threading import Thread from threading import Thread
from tractor._ipc import Channel from tractor.ipc import Channel
from tractor._runtime import ( from tractor._runtime import (
Actor, Actor,
) )

View File

@ -0,0 +1,11 @@
from ._chan import (
_connect_chan,
MsgTransport,
Channel
)
__all__ = [
'_connect_chan',
'MsgTransport',
'Channel'
]

View File

@ -92,7 +92,7 @@ class StackLevelAdapter(LoggerAdapter):
) -> None: ) -> None:
''' '''
IPC transport level msg IO; generally anything below IPC transport level msg IO; generally anything below
`._ipc.Channel` and friends. `.ipc.Channel` and friends.
''' '''
return self.log(5, msg) return self.log(5, msg)
@ -285,7 +285,7 @@ def get_logger(
# NOTE: for handling for modules that use ``get_logger(__name__)`` # NOTE: for handling for modules that use ``get_logger(__name__)``
# we make the following stylistic choice: # we make the following stylistic choice:
# - always avoid duplicate project-package token # - always avoid duplicate project-package token
# in msg output: i.e. tractor.tractor _ipc.py in header # in msg output: i.e. tractor.tractor.ipc._chan.py in header
# looks ridiculous XD # looks ridiculous XD
# - never show the leaf module name in the {name} part # - never show the leaf module name in the {name} part
# since in python the {filename} is always this same # since in python the {filename} is always this same