Changeset View
Changeset View
Standalone View
Standalone View
python_modules/dagster/dagster/grpc/client.py
Show All 21 Lines | from .types import ( | ||||
CancelExecutionRequest, | CancelExecutionRequest, | ||||
ExecuteExternalPipelineArgs, | ExecuteExternalPipelineArgs, | ||||
ExecutionPlanSnapshotArgs, | ExecutionPlanSnapshotArgs, | ||||
ExternalScheduleExecutionArgs, | ExternalScheduleExecutionArgs, | ||||
PartitionArgs, | PartitionArgs, | ||||
PartitionNamesArgs, | PartitionNamesArgs, | ||||
PartitionSetExecutionParamArgs, | PartitionSetExecutionParamArgs, | ||||
PipelineSubsetSnapshotArgs, | PipelineSubsetSnapshotArgs, | ||||
SensorExecutionArgs, | |||||
) | ) | ||||
CLIENT_HEARTBEAT_INTERVAL = 1 | CLIENT_HEARTBEAT_INTERVAL = 1 | ||||
def client_heartbeat_thread(client, shutdown_event): | def client_heartbeat_thread(client, shutdown_event): | ||||
while True: | while True: | ||||
shutdown_event.wait(CLIENT_HEARTBEAT_INTERVAL) | shutdown_event.wait(CLIENT_HEARTBEAT_INTERVAL) | ||||
▲ Show 20 Lines • Show All 212 Lines • ▼ Show 20 Lines | def external_schedule_execution(self, external_schedule_execution_args): | ||||
external_schedule_execution_args | external_schedule_execution_args | ||||
), | ), | ||||
) | ) | ||||
return deserialize_json_to_dagster_namedtuple( | return deserialize_json_to_dagster_namedtuple( | ||||
res.serialized_external_schedule_execution_data_or_external_schedule_execution_error | res.serialized_external_schedule_execution_data_or_external_schedule_execution_error | ||||
) | ) | ||||
def external_sensor_execution(self, sensor_execution_args): | |||||
check.inst_param( | |||||
sensor_execution_args, "sensor_execution_args", SensorExecutionArgs, | |||||
) | |||||
res = self._query( | |||||
"ExternalSensorExecution", | |||||
api_pb2.ExternalSensorExecutionRequest, | |||||
serialized_external_sensor_execution_args=serialize_dagster_namedtuple( | |||||
sensor_execution_args | |||||
), | |||||
) | |||||
return deserialize_json_to_dagster_namedtuple( | |||||
res.serialized_external_sensor_execution_data_or_external_sensor_execution_error | |||||
) | |||||
def shutdown_server(self, timeout=15): | def shutdown_server(self, timeout=15): | ||||
res = self._query("ShutdownServer", api_pb2.Empty, timeout=timeout) | res = self._query("ShutdownServer", api_pb2.Empty, timeout=timeout) | ||||
return deserialize_json_to_dagster_namedtuple(res.serialized_shutdown_server_result) | return deserialize_json_to_dagster_namedtuple(res.serialized_shutdown_server_result) | ||||
def cancel_execution(self, cancel_execution_request): | def cancel_execution(self, cancel_execution_request): | ||||
check.inst_param( | check.inst_param( | ||||
cancel_execution_request, "cancel_execution_request", CancelExecutionRequest, | cancel_execution_request, "cancel_execution_request", CancelExecutionRequest, | ||||
) | ) | ||||
▲ Show 20 Lines • Show All 119 Lines • Show Last 20 Lines |