"""
This type stub file was generated by pyright.
"""

import concurrent.futures
import temporalio.api.common.v1
import temporalio.bridge.worker
import temporalio.client
import temporalio.common
import temporalio.converter
from dataclasses import dataclass
from typing import Any, Callable, Optional, Sequence, Type
from ._interceptor import Interceptor

"""Nexus worker"""
_TEMPORAL_FAILURE_PROTO_TYPE = ...
class _NexusWorker:
    def __init__(self, *, bridge_worker: Callable[[], temporalio.bridge.worker.Worker], client: temporalio.client.Client, task_queue: str, service_handlers: Sequence[Any], data_converter: temporalio.converter.DataConverter, interceptors: Sequence[Interceptor], metric_meter: temporalio.common.MetricMeter, executor: Optional[concurrent.futures.Executor]) -> None:
        ...
    
    async def run(self) -> None:
        """Continually poll for Nexus tasks and dispatch to handlers."""
        ...
    
    async def drain_poll_queue(self) -> None:
        ...
    
    async def wait_all_completed(self) -> None:
        ...
    


@dataclass
class _DummyPayloadSerializer:
    data_converter: temporalio.converter.DataConverter
    payload: temporalio.api.common.v1.Payload
    async def serialize(self, value: Any) -> nexusrpc.Content:
        ...
    
    async def deserialize(self, content: nexusrpc.Content, as_type: Optional[Type[Any]] = ...) -> Any:
        ...
    


