SoulFire TypeScript SDK 2.10.3
    Preparing search index...

    Class SoulFireTasks

    Start and observe durable server jobs for one bot.

    Access this API through SoulFireBot.tasks. Named start methods return SoulFireTask after acceptance. Use yield* task.result() for successful completion. run* methods instead stream events with cancellation tied to RPC ownership by default.

    A call timeout limits transport work. A task deadline limits server execution. For submission retries, reuse an idempotency key to avoid duplicate work.

    Index
    • Submit a task and stream progress with RPC ownership.

      Type Parameters

      • Input extends DescMessage

      Parameters

      • inputSchema: Input

        Protobuf schema for the task input.

      • input: MessageInitShape<Input>

        Task configuration.

      • options: TaskStartOptions = {}

        Scheduling and request options. disconnectPolicy defaults to CANCEL_WITH_CALL, rather than the server's unspecified policy.

      Returns Stream<BotTaskEvent, SoulFireOperationError>

      A lazy Stream of task events. Consumption starts the job.

      Closing or interrupting the stream cancels unfinished work by default. An explicit disconnect policy can select different behavior. Task failures also appear in event snapshots; inspect their status.

    • Submit a protobuf task input and return a handle after acceptance.

      Type Parameters

      • Input extends DescMessage
      • Result extends DescMessage | undefined = undefined

      Parameters

      • inputSchema: Input

        Protobuf schema for the task input.

      • input: MessageInitShape<Input>

        Task configuration, before protobuf serialization.

      • OptionalresultSchema: Result

        Matching protobuf schema used to decode task.result().

      • options: TaskStartOptions = {}

        Scheduling, lifecycle, deadline, and request configuration.

      Returns Effect<SoulFireTask<Result>, SoulFireOperationError>

      An Effect that produces a typed task handle.

      This operation does not wait for completion or register a cancellation finalizer. Use run for stream ownership or cancel the handle explicitly.