Skip to content

streaming asynchronous exception #104

@tim2CF

Description

@tim2CF

Hi! I'm using async package to manage my threads. In many places race function is very handy. For example:

res <- race receiveLongServerStream executeSomethingShort

where receiveLongServerStream is client action which receives some events from gRPC server, any amount of events, basically it's infinite thread

and executeSomethingShort is something short-living process which should normally return value first, then race function should cancel receiveLongServerStream and return res which is supposed to be Right there, because executeSomethingShort returned value first.

But for some reason all expression is blocked, probably because race can't cancel receiveLongServerStream for some reason. Here is docs for cancel function if it can help

https://hackage.haskell.org/package/async-2.2.2/docs/Control-Concurrent-Async.html#v:cancel

I just want to know how I can deal with it. Because this behaviour is causing deadlocks.

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