Skip to content

Unhandled signal #4

@leowmjw

Description

@leowmjw

For test case sending multiple same signal at the same time; it detects unhandled signal

			env.SignalWorkflow("signal-receive-with-timeout", &message)
			env.SignalWorkflow("signal-receive-with-timeout-clone", &message)
			env.SignalWorkflow("signal-receive-with-timeout", &message)
			env.SignalWorkflow("signal-receive-with-timeout", &message)

The newer SDK also have selector.HasPending but not sure if that is useful in this scenario

Maybe something like below:

	selector.AddFuture(
		timer,
		func(f workflow.Future) {
			if err := f.Get(ctx, nil); err != nil && temporal.IsCanceledError(err) {
				fmt.Println("WORKFLOW CANCELED!!!!!")
				isCancelled = true
			} else {
				fmt.Println("TIMED OUT!!!")
				hasTimedOut = true
			}
		},
	)
	selector.AddReceive(
		sigCh,
		func(c workflow.ReceiveChannel, more bool) {
                        // This handles multiple signals of same type
			for c.ReceiveAsync(valuePtr) {
				fmt.Println("MORE SIGNALS!!!")
			}
		},
	)


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions