Skip to main content

Engine

WIP

State machine, scheduling, and retry model for uploads.

The engine runs the upload state machine, scheduler, and side effects. State changes go through the reducer; public events emit from one transition layer.

State Machine

Loading diagram...

Scheduling

The scheduler keeps making progress:

  • Intent creation for items in creating_intent.
  • Upload slots for queued items, up to the configured concurrency limit.
  • Finalization for items in completing.

Event Emission

Public events emit from store.runtime.ts after transitions, not inside handlers. That prevents duplicates and keeps semantics consistent.

Internal EventPublic Event
validation.okvalidation.ok + intent.creating
upload.beginupload.started
upload.okupload.completing
complete.okupload.completed

file.rejected emits during addFiles because rejected files never enter state.

Retry Model

retryDecision centralizes retry policy. Handlers ask for a decision; they don't hardcode retry logic. The default allows up to 3 attempts with exponential backoff.