new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Temporal · Develop · all subjects

nexus/timeouts

8 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Set Nexus Operation timeouts example

```csharp // Schedule-to-Close timeout var output = await Workflow.CreateNexusWorkflowClient<IHelloService>(IHelloService.EndpointName). ExecuteNexusOperationAsync(svc => svc.SayHello(new(name, language)), new NexusWorkflowOperationOptions { ScheduleToCloseTimeout = TimeSpan.FromMinutes(10), }); // Schedule-to-Start timeout var output = await Workflow.CreateNexusWorkflowClient<IHelloService>(IHelloService.EndpointName). ExecuteNexusOperationAsync(svc => svc.SayHello(new(name, language)), new NexusWorkflowOperationOptions { ScheduleToStartTimeout = TimeSpan.FromMinutes(2), }); // Start-to-Close timeout var output = await Workflow.CreateNexusWorkflowClient<IHelloService>(IHelloService.EndpointName). ExecuteNexusOperationAsync(svc => svc.SayHello(new(name, language)), new NexusWorkflowOperationOptions { StartToCloseTimeout = TimeSpan.FromMinutes(5), }); ``` These examples show setting the three types of Nexus Operation timeouts in `NexusWorkflowOperationOptions`.

ScheduleToCloseTimeout option for Nexus operations

Nexus operations support workflow.NexusOperationOptions with ScheduleToCloseTimeout, a time.Duration field specifying the maximum time allowed for the operation from scheduling to completion. In the quickstart example, it is set to 10 * time.Second.

Nexus Operation timeout types

Nexus Operations support three types of timeouts that control how long the caller is willing to wait at different stages of the Operation lifecycle: Schedule-to-Close timeout (total duration from scheduled to completion), Schedule-to-Start timeout (how long to wait for the Operation to be started), and Start-to-Close timeout (how long to wait for an asynchronous Operation to complete after being started). Set these timeouts in NexusOperationOptions when calling ExecuteOperation.

Set Schedule-to-Close timeout for Nexus Operation

The Schedule-to-Close timeout limits the total duration of the Operation from when it is scheduled to when it completes. The Nexus Machinery automatically retries failed requests until this timeout is exceeded. Set it in NexusOperationOptions: workflow.NexusOperationOptions{ ScheduleToCloseTimeout: 10 * time.Minute }

Set Schedule-to-Start timeout for Nexus Operation

The Schedule-to-Start timeout limits how long the caller will wait for the Operation to be started by the handler. If not set, no Schedule-to-Start timeout is enforced. Set it in NexusOperationOptions: workflow.NexusOperationOptions{ ScheduleToStartTimeout: 2 * time.Minute }

Set Start-to-Close timeout for Nexus Operation

The Start-to-Close timeout limits how long the caller will wait for an asynchronous Operation to complete after it has been started. This timeout only applies to asynchronous Operations. If not set, no Start-to-Close timeout is enforced. Set it in NexusOperationOptions: workflow.NexusOperationOptions{ StartToCloseTimeout: 5 * time.Minute }

Schedule to close timeout for Nexus Operations

When executing a Nexus Operation from a Workflow using `nexusClient.executeOperation()`, specify a `scheduleToCloseTimeout` option such as `{ scheduleToCloseTimeout: '10s' }`. This timeout must not exceed the Nexus request timeout limit.

Nexus request timeout deadline

The Nexus request timeout is 10 seconds. Handler context exposes `ctx.requestDeadline` as an optional Date representing when the current request must complete. This is the deadline for the current request, not the overall operation. Use it to decide whether to start work that may not finish in time or to set timeouts on downstream calls.

Give your agent this brain