Skip to content

cancel should be done with an outbound user event #97

Closed
@weissi

Description

@weissi

self.lock.withLock {
if !cancelled {
cancelled = true
channel?.pipeline.fireUserInboundEventTriggered(TaskCancelEvent())
}

the above code would be better done with an outbound user event, so something like

channel.triggerOutboundUserEvent(CancelEvent)

as an added benefit, that returns a promise so we can know if that was successful or not. The promise will be failed automatically if that has been handled before or the channel is already closed.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions