Skip to content

A CollectSTM that races local decisions versus message arrivals #96

Description

@nfrisby

In all releases of typed-protocols so far, the Collect primitive forces the mini protocol client to decide whether it has any possible work to do while waiting for the corresponding reply to arrive in order to react to said arrival. However, it's possible that the mini protocol wants to try to react to that arrival before it happens, and then---still before the arrival---something else changes and now the mini protocol can/should pipeline another message, even before the corresponding reply arrives.

The current Collect signature does not allow for that. If the Maybe were replaced with an STM (Maybe ...), then it could: the driver would race the arrival of the reply against this STM transaction return a continuation.

This signature of CollectSTM in this commit looks similar 2c947f1

Activity

  1. added theissue type on Oct 5, 2026
  2. nfrisby commented on Oct 5, 2026

    @nfrisby
    ContributorAuthor

    PR IntersectMBO/ouroboros-consensus#2344 rolls its own version of CollectSTM for a good reason (to enable graceful and prompt shutdown of a deeply-pipelined notification protocol that should allow for bursts of events).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions