# Generated by the Protocol Buffers compiler. DO NOT EDIT!
# source: protoactor/remote/protos_remote.proto
# plugin: grpclib.plugin.main
import abc
import typing

import grpclib.const
import grpclib.client
if typing.TYPE_CHECKING:
    import grpclib.server

import protoactor.actor.protos_pb2
import protoactor.remote.protos_remote_pb2


class RemotingBase(abc.ABC):

    @abc.abstractmethod
    async def Connect(self, stream: 'grpclib.server.Stream[protoactor.remote.protos_remote_pb2.ConnectRequest, protoactor.remote.protos_remote_pb2.ConnectResponse]') -> None:
        pass

    @abc.abstractmethod
    async def Receive(self, stream: 'grpclib.server.Stream[protoactor.remote.protos_remote_pb2.MessageBatch, protoactor.remote.protos_remote_pb2.Unit]') -> None:
        pass

    def __mapping__(self) -> typing.Dict[str, grpclib.const.Handler]:
        return {
            '/remote.Remoting/Connect': grpclib.const.Handler(
                self.Connect,
                grpclib.const.Cardinality.UNARY_UNARY,
                protoactor.remote.protos_remote_pb2.ConnectRequest,
                protoactor.remote.protos_remote_pb2.ConnectResponse,
            ),
            '/remote.Remoting/Receive': grpclib.const.Handler(
                self.Receive,
                grpclib.const.Cardinality.STREAM_STREAM,
                protoactor.remote.protos_remote_pb2.MessageBatch,
                protoactor.remote.protos_remote_pb2.Unit,
            ),
        }


class RemotingStub:

    def __init__(self, channel: grpclib.client.Channel) -> None:
        self.Connect = grpclib.client.UnaryUnaryMethod(
            channel,
            '/remote.Remoting/Connect',
            protoactor.remote.protos_remote_pb2.ConnectRequest,
            protoactor.remote.protos_remote_pb2.ConnectResponse,
        )
        self.Receive = grpclib.client.StreamStreamMethod(
            channel,
            '/remote.Remoting/Receive',
            protoactor.remote.protos_remote_pb2.MessageBatch,
            protoactor.remote.protos_remote_pb2.Unit,
        )
