Skip to content

acquiring has to be cancellable #10

@michaelficarra

Description

@michaelficarra

We thought that this may be the case, but I was really confronted with the need when implementing the summing combinator (any) in #9. The only way we can "race" Governors is to try to acquire all of them and then race the promises. Unfortunately, once we acquire the first one, we can't cancel the other attempts. Instead, we just have to queue up a release once they resolve. This wouldn't be so bad if we were only considering simple counting Governors. But since we want Governors to also be able to implement time-based rate limiting, acquiring and immediately releasing a token is not equivalent to aborting an acquisition attempt (or just never attempting to acquire). So I don't see any way around depending on some kind of 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