Class: NativeConnection
worker.NativeConnection
A Native Connection object that delegates calls to the Rust Core binary extension.
A Worker must use this class to connect to the server.
Do not confuse this connection class with @temporalio/client
's Connection.
Methods
close
▸ close(): Promise
<void
>
Close this connection.
Make sure any Workers using this connection are stopped before calling this method or it will throw an IllegalStateError
Returns
Promise
<void
>
setMetadata
▸ setMetadata(metadata
): Promise
<void
>
Mapping of gRPC metadata (HTTP headers) to send with each request to the server.
Use metadata to set the initial metadata for client creation.
Parameters
Name | Type |
---|---|
metadata | Record <string , string > |
Returns
Promise
<void
>
connect
▸ Static
connect(options?
): Promise
<NativeConnection
>
Eagerly connect to the Temporal server and return a NativeConnection instance
Parameters
Name | Type |
---|---|
options? | NativeConnectionOptions |
Returns
Promise
<NativeConnection
>
create
▸ Static
create(options?
): Promise
<NativeConnection
>
Deprecated
use connect
instead
Parameters
Name | Type |
---|---|
options? | NativeConnectionOptions |
Returns
Promise
<NativeConnection
>