Skip to content

Commit

Permalink
Mark NewTimerWithOptions as Experimental (#1619)
Browse files Browse the repository at this point in the history
  • Loading branch information
Quinn-With-Two-Ns authored Sep 3, 2024
1 parent 2af8c72 commit 52ea97f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ type WorkflowOutboundInterceptor interface {
NewTimer(ctx Context, d time.Duration) Future

// NewTimer intercepts workflow.NewTimerWithOptions.
//
// NOTE: Experimental
NewTimerWithOptions(ctx Context, d time.Duration, options TimerOptions) Future

// Sleep intercepts workflow.Sleep.
Expand Down Expand Up @@ -331,7 +333,8 @@ type WorkflowOutboundInterceptor interface {
//
// NOTE: Experimental
ExecuteNexusOperation(ctx Context, input ExecuteNexusOperationInput) NexusOperationFuture
// RequestCancelNexusOperation intercepts Nexus Operation cancelation via context.

// RequestCancelNexusOperation intercepts Nexus Operation cancellation via context.
//
// NOTE: Experimental
RequestCancelNexusOperation(ctx Context, input RequestCancelNexusOperationInput)
Expand Down
2 changes: 2 additions & 0 deletions internal/interceptor_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ func (w *WorkflowOutboundInterceptorBase) NewTimer(ctx Context, d time.Duration)
}

// NewTimerWithOptions implements WorkflowOutboundInterceptor.NewTimerWithOptions.
//
// NOTE: Experimental
func (w *WorkflowOutboundInterceptorBase) NewTimerWithOptions(
ctx Context,
d time.Duration,
Expand Down
2 changes: 2 additions & 0 deletions internal/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,8 @@ type (
}

// TimerOptions are options set when creating a timer.
//
// NOTE: Experimental
TimerOptions struct {
// Summary is a simple string identifying this timer. While it can be
// normal text, it is best to treat as a timer ID. This value will be
Expand Down
4 changes: 4 additions & 0 deletions workflow/deterministic_wrappers.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ type (
Semaphore = internal.Semaphore

// TimerOptions are options for [NewTimerWithOptions]
//
// NOTE: Experimental
TimerOptions = internal.TimerOptions
)

Expand Down Expand Up @@ -199,6 +201,8 @@ func NewTimer(ctx Context, d time.Duration) Future {
// use this NewTimerWithOptions() to get the timer, instead of Go's timer.NewTimer(). You can cancel the pending timer
// by canceling the Context (using the context from workflow.WithCancel(ctx)) and that will cancel the timer. After the
// timer is canceled, the returned Future becomes ready, and Future.Get() will return *CanceledError.
//
// NOTE: Experimental
func NewTimerWithOptions(ctx Context, d time.Duration, options TimerOptions) Future {
return internal.NewTimerWithOptions(ctx, d, options)
}
Expand Down

0 comments on commit 52ea97f

Please sign in to comment.