class Runtime: (source)
Constructors: Runtime.default(), Runtime(telemetry, worker_heartbeat_interval)
Runtime for Temporal Python SDK.
Most users are encouraged to use default. It can be set with
set_default. Every time a new runtime is created, a new internal
thread pool is created.
Runtimes do not work across forks. Advanced users should consider using
prevent_default and :py:meth`set_default to ensure each
fork creates it's own runtime.
| Class Method | default |
Get the default runtime, creating if not already created. If prevent_default is called before this method it will raise a RuntimeError instead of creating a default runtime. |
| Class Method | prevent |
Prevent default from lazily creating a Runtime. |
| Static Method | set |
Set the default runtime to the given runtime. |
| Method | __init__ |
Create a runtime with the provided configuration. |
| Property | metric |
Metric meter for this runtime. This is a no-op metric meter if no metrics were configured. |
| Instance Variable | _core |
Undocumented |
| Instance Variable | _metric |
Undocumented |
Get the default runtime, creating if not already created. If prevent_default
is called before this method it will raise a RuntimeError instead of creating a default
runtime.
If the default runtime needs to be different, it should be done with
set_default before this is called or ever used.
| Returns | |
Runtime | The default runtime. |
Prevent default from lazily creating a Runtime.
Raises a RuntimeError if a default Runtime has already been created.
Explicitly setting a default runtime with set_default bypasses this setting and
future calls to default will return the provided runtime.
Set the default runtime to the given runtime.
This should be called before any Temporal client is created, but can change the existing one. Any clients and workers created with the previous runtime will stay on that runtime.
| Parameters | |
runtime:Runtime | The runtime to set. |
errorbool | If True and default is already set, this will raise a RuntimeError. |
TelemetryConfig, worker_heartbeat_interval: timedelta | None = timedelta(Create a runtime with the provided configuration.
Each new runtime creates a new internal thread pool, so use sparingly.
| Parameters | |
telemetry:TelemetryConfig | Telemetry configuration when not supplying runtime_options. |
workertimedelta | None | Interval for worker heartbeats. None disables heartbeating. Interval must be between 1s and 60s. |
| Raises | |
ValueError | If both `runtime_options is a negative value. |