Skip to content
client.pyi 675 B
Newer Older
Dom Sekotill's avatar
Dom Sekotill committed
from typing import Callable
from typing import Union

from ..client import BaseClient
from .proto import Request
from .proto import Response
from .proto import ServerMessage

__all__ = [
	"Client",
]

MessageHandler = Callable[[ServerMessage], None]


class Client(BaseClient):

	def __init__(
		self,
		host: str,
		port: int, *,
		timeout: Union[float, None] = None,
		passwd: Union[str, None] = None,
		message_handler: MessageHandler = ...,
	) -> None: ...

	def receive(self, max_length: int = ...) -> Response: ...
	def communicate(self, request: Request) -> Response: ...
	def login(self, passwd: str) -> bool: ...
	def run(self, command: str, *args: str) -> str: ...