# Generated by the protocol buffer compiler.  DO NOT EDIT!
# Source: dispatcher/dispatcher.proto for package ''

require 'grpc'
require 'dispatcher/dispatcher_pb'

module Dispatcher
  class Service

    include ::GRPC::GenericService

    self.marshal_class_method = :encode
    self.unmarshal_class_method = :decode
    self.service_name = 'Dispatcher'

    rpc :Register, ::WorkerRegisterRequest, ::WorkerRegisterResponse
    rpc :Listen, ::WorkerListenRequest, stream(::AssignedAction)
    # ListenV2 is like listen, but implementation does not include heartbeats. This should only used by SDKs
    # against engine version v0.18.1+
    rpc :ListenV2, ::WorkerListenRequest, stream(::AssignedAction)
    # Heartbeat is a method for workers to send heartbeats to the dispatcher
    rpc :Heartbeat, ::HeartbeatRequest, ::HeartbeatResponse
    rpc :SubscribeToWorkflowEvents, ::SubscribeToWorkflowEventsRequest, stream(::WorkflowEvent)
    rpc :SubscribeToWorkflowRuns, stream(::SubscribeToWorkflowRunsRequest), stream(::WorkflowRunEvent)
    rpc :SendStepActionEvent, ::StepActionEvent, ::ActionEventResponse
    rpc :SendGroupKeyActionEvent, ::GroupKeyActionEvent, ::ActionEventResponse
    rpc :PutOverridesData, ::OverridesData, ::OverridesDataResponse
    rpc :Unsubscribe, ::WorkerUnsubscribeRequest, ::WorkerUnsubscribeResponse
    rpc :RefreshTimeout, ::RefreshTimeoutRequest, ::RefreshTimeoutResponse
    rpc :ReleaseSlot, ::ReleaseSlotRequest, ::ReleaseSlotResponse
    rpc :RestoreEvictedTask, ::RestoreEvictedTaskRequest, ::RestoreEvictedTaskResponse
    rpc :UpsertWorkerLabels, ::UpsertWorkerLabelsRequest, ::UpsertWorkerLabelsResponse
    # GetVersion returns the dispatcher protocol version as a simple integer.
    # SDKs use this to determine feature support (e.g. slot_config registration).
    # Old engines that do not implement this RPC will return UNIMPLEMENTED.
    rpc :GetVersion, ::GetVersionRequest, ::GetVersionResponse
  end

  Stub = Service.rpc_stub_class
end
