effect-uai-mid-stream-abort

Installation
SKILL.md

effect-uai mid-stream-abort

Cancel an in-flight streamTurn cleanly via Stream.interruptWhen(Deferred.await(abort)). When the deferred completes, the stream interrupts, its scope closes, Effect's structured concurrency tears down the HTTP response, and the underlying fetch is aborted — the TCP connection drops.

Reach for this when the user says any of:

  • "Stop button for the model"
  • "Abort the current turn when a new prompt arrives"
  • "Hard deadline on a single response"

The pattern

import { Deferred, Effect, Stream, pipe } from "effect"
import { loop, stop, streamUntilComplete } from "@effect-uai/core/Loop"
Related skills

More from betalyra/effect-uai

Installs
2
GitHub Stars
2
First Seen
11 days ago