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
>
setHeaders
▸ setHeaders(headers
): Promise
<void
>
Set HTTP headers to be set in each gRPC request.
Use NativeConnectionOptions.headers to set the initial headers for client creation.
Parameters
Name | Type |
---|---|
headers | Record <string , string > |
Returns
Promise
<void
>
create
▸ Static
create(options?
): Promise
<NativeConnection
>
Parameters
Name | Type |
---|---|
options? | NativeConnectionOptions |
Returns
Promise
<NativeConnection
>