Skip to content

What are the semantics of attempt + cancellation? #104

Closed
@natefaubion

Description

@natefaubion

If I have this code:

do
  canceler <- forkAff do
    res <- attempt do
      delay (Milliseconds 100.0)
      pure unit
    case res of
      Left err -> logShow error
      Right _  -> log "Done"
  delay (Milliseconds 10.0)
  canceled <- cancel canceler (error "Stop!")
  when canceled do
    log "Canceled"

What should this log? Should attempt mask a cancellation attempt, and prevent cancellation?

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