class

Arcana::AI::Context

Inherits Reference < Object

Cancellation context for in-flight API requests.

Create a context, pass it to complete, and call cancel from another fiber to abort the request.

ctx = Arcana::AI::Context.new spawn { sleep 5.seconds; ctx.cancel } response = provider.complete(request, ctx)

Constructors

Instance methods

cancel

Cancel the context. Safe to call multiple times.

Source
cancelled?
Source
wait(timeout : Time::Span) : Bool

Block until cancelled or timeout. Returns true if cancelled.

Source