Work
reaktor-work runs workflows that outlive the process that started them. A workflow is a graph node, and its steps,
waits and child runs are declared as its members. Work records every step's result in a store. When something is due,
the platform's own scheduler wakes the process: WorkManager on Android, BGTaskScheduler on iOS, Quartz on a JVM
server, a timer in the browser or in Hangar's host. On Cloudflare Workers each run is a Cloudflare Workflows instance.
Hangar shows every run as a graph of its steps and lets an operator cancel, retry or reconcile it. A workflow that
only has to finish within one request can run inline instead: the same declarations, run by the caller, with
no store.
Status on 7 November 2026. The engine, its 32 conformance checks, the stores and all six hosts are built. The checks pass on the JVM, in Kotlin/JS, on an Android phone and on an iPhone, and every host has passed its proof on real processes, a reboot of the Android phone included. Hosts and wake-ups lists each proof and the first measurements. Inline runs were added on 7 November. BestBuds' Workers declare 33 of their flows with them, the circle lifecycle's advance and account purge included.
Overview#
A run moves forward in small, recorded transactions. The planner reads the run's record and works out which steps are ready, which are skipped and when the run next needs attention. The executor claims the ready steps by writing a lease into the record, runs them, and writes each result back only if its lease is still current. Between those transactions the run lives only in the store, so any process that opens the store can carry on: the same app after a crash, a phone after a reboot, or a second server after the first one died.
| Part | What it is | How you use it |
|---|---|---|
| Workflow | A graph node whose members are its input, steps, signals, timers and child runs. | class Fulfil(graph: Graph) : Workflow(graph, "shop.fulfil", "Fulfil"), Durable<Order, Receipt> |
| Inline workflow | A workflow of steps that its caller runs one after another, recording nothing. | class PlanRsvpFlow(graph: Graph) : Workflow(…), Inline<Rsvping, Answered>, called as planRsvp(rsvping) |
| Step | A suspend function with an effect class, a timeout, and optional reconcile and undo functions. | val charge by step(input, effect = Effect.ProductionReversibleWrite) { … } |
| Run | One execution of a workflow, named by a key you choose. | work.start(fulfil, order, key = order.id) |
| Run record | The run's state: each step's state, attempt, lease, result and reason. | run.record(), run.updates |
| Work | The node that admits runs, plans what is due and runs it. | Work(graph, scope, store, scheduler, authority, owner) |
| Store | Where run records and their journal live: SQLite, PostgreSQL, D1 or SQLite in the browser. | ObjectWorkStore(database) |
| Scheduler | The platform's wake-up mechanism, armed for the next due time of a scope. | LiveScheduler, QuartzWorkScheduler, AndroidWorkScheduler, … |
| Inspector | Reads runs, definitions and history for Hangar and the kernel, and applies controls. | WorkInspector, WorkController |
Try it#
Hangar's host carries a small workflow that proves a run survives a restart of the host. It records which process started it, waits one minute on a timer, records which process finished it, and takes one of two branches depending on whether the two processes differ.
class RestartCheck(graph: Graph, private val clock: Clock = Clock.System) :
Workflow(graph, "hangar.work.restart-check", "Restart check"), Durable<Unit, String> {
override val input by input<Unit>()
val started by step(input, effect = Effect.ReadOnly) { mark() }
val pause by timer(1.minutes)
val finished by step(started, pause, effect = Effect.ReadOnly) { first, _ -> HostReport(first, mark()) }
val resumed by step(finished, effect = Effect.ReadOnly, on = finished.matches(AnotherProcess) { it.restarted }) {
"Resumed after a restart: process ${it.started.processId} started it and process ${it.finished.processId} finished it"
}
val uninterrupted by step(finished, effect = Effect.ReadOnly, on = !finished.matches(AnotherProcess) { it.restarted }) {
"Ran without a restart in process ${it.finished.processId}"
}
val outcome by either(resumed, uninterrupted)
override val output = outcome
}
Start it from a terminal or a coding agent with the kernel operation work.start, then restart Hangar's host within
the minute:
reaktor work start --args '{"workflow":"hangar.work.restart-check","key":"check-1"}'
On 6 November 2026 the run live-1 started in host process 66635 at 14:27:30. The host restarted at 14:28:27, the new
process 68205 fired the timer at 14:28:31, and the run ended with "Resumed after a restart: process 66635 started it
and process 68205 finished it". The uninterrupted step was skipped. Cloud → Work in Hangar shows the run's steps and
their states while it waits and after it ends. Starting it again with the same key returns the same run.
How it works#
Declaring a workflow#
A workflow is a graph node that implements Durable<I, O>. Each member declared with by is a
node of the workflow, named after its property, and each step lists the earlier nodes whose results it takes. The
workflow names its input and its output. Steps, conditions and either come from the graph.step package of
reaktor-graph, and Work adds the waits and child runs. problems(output) names a step that no
run can reach, a condition that can never hold and a result that nothing uses, and WorkflowPlan refuses a workflow
that has one.
class Fulfil(graph: Graph, private val shop: Shop) :
Workflow(graph, "shop.fulfil", "Fulfil an order"), Durable<Order, Receipt> {
override val input by input<Order>()
val charge by step(input, effect = Effect.ProductionReversibleWrite,
reconcile = { shop.findCharge(effectKey) },
undo = { charge -> shop.refund(charge) }) { order -> shop.charge(order, effectKey) }
val packed by signal<Packing>(timeout = 2.days)
val ship by step(charge, packed, effect = Effect.UnknownRemoteEffect) { charge, packing -> shop.ship(charge, packing, effectKey) }
val receipt by step(ship, effect = Effect.ReadOnly) { shipment -> Receipt(shipment.tracking) }
override val output = receipt
}
| Declaration | What it does |
|---|---|
input<T>() | The run's input, stored in the record when the run starts. |
step(a, b, effect = …) { a, b -> … } | Runs a suspend function on the results of up to four earlier nodes and records what it returns. |
signal<T>(timeout, sender) | Waits for a typed value delivered with run.signal(node, value). With a timeout it ends as timed out when nothing arrives in time. |
timer(after) | Waits for a duration, counted from the moment the timer opens. |
call(workflow, input) | Starts one child run and takes its result. |
each(workflow, items) | Starts one child run per item of a list and collects their results in the list's order. |
loop(workflow, seed, limit) { next } | Runs a child, then runs it again with the value next returns, until next returns null or the limit is reached. |
either(a, b, …) | Waits until all its options have ended and takes the result of the first one that succeeded. |
Work finds the workflows among the members of its own graph, so a workflow belongs to the graph whose Work node runs
it. Two workflows in one graph cannot share an id. Durable also carries two requirements: requirement says who may
start runs, and operatorRetry says who may retry or reconcile them; without it nobody can.
Conditions#
Every node takes an optional on = condition over earlier nodes. a.succeeded, a.failed, a.skipped,
a.timedOut and a.matches("description") { predicate } combine with and, or and !. A condition stays unknown
while the nodes it reads are still running or waiting, so the node waits too. When the condition turns out false, the
node is skipped, and every node that needs a skipped result is skipped after it.
A condition that reads a.failed or a.timedOut handles that outcome. The run then carries on along that branch, and
the failure of a does not fail the run. In the restart check, resumed and uninterrupted read the same result
with opposite conditions, one of them is skipped, and either takes the other.
Running inside a request#
A workflow that implements Inline<I, O> in place of Durable<I, O> runs inside the code that calls it and records
nothing. Calling it like a function runs its steps one after another, in the order they are declared, on the caller's
coroutine, and returns its output. Each step is still a call that the graph's interceptors see, so each step gets its
own span, and each step's timeout applies. BestBuds answers a plan RSVP this way, inside the Worker request that
carries it. The step bodies below are abridged:
class PlanRsvpFlow(graph: Graph) : Workflow(graph, "social/plan-rsvp", "Answer a plan"), Inline<Rsvping, Answered> {
override val input by input<Rsvping>()
val visible by step(input, effect = Effect.LiveRead) { it.session.visible(it.answer.id) }
val eligibility by step(input, visible, effect = Effect.ReadOnly) { rsvping, found -> refuse(rsvping.problem(found)) }
val answered by step(input, visible, eligibility, effect = Effect.ProductionReversibleWrite) { rsvping, found, _ -> rsvping.save(found) }
val told by step(input, answered, effect = Effect.ProductionReversibleWrite) { rsvping, answered -> rsvping.tellMembers(answered) }
val notified by step(input, answered, effect = Effect.ProductionReversibleWrite,
on = answered.matches("someone joins") { it.joining }) { rsvping, answered -> rsvping.notifyHost(answered) }
override val output = answered
}
override val rsvp = super.rsvp.handle { answer -> signedIn { latest(planRsvp(Rsvping(this, answer)).found.id) } }
Because nothing is stored, the input and the values that steps pass on can be anything, such as a signed-in session
with its open database connection. WorkflowPlan refuses a workflow that holds a value it cannot store, so such a
workflow runs only inline. Inside a step, exchange() names the step's own call rather than the request, so a step
that needs the request takes it from the input.
- A step whose body returns null ends skipped, and every step that needs its result is skipped after it.
- A step that throws or runs out of time, while no condition reads its
failedortimedOut, ends the run. The steps after it do not run, nothing is undone, and the caller gets the exception the step threw, orStepFailedwhen it ran out of time. - When a condition reads that outcome, the run carries on along that branch. If the run still ends without its output, for example because the handling step's own condition turned out false, the call throws the failure that ended it.
- Each step runs once.
attemptis always 1,checkpointthrows, andeffectKeyjoins the request's trace id, the workflow id and the step name, so it does not survive a client's retry. - Only an input, steps and
eithercan run inline. A second input, a signal, a timer or a child run makes the first call throw, naming that member.
Hangar's Graph map draws an inline workflow like a durable one: its card lists the steps with their effects and conditions.
A node that runs another node's inline workflow consumes it through a port, as it would consume a service. The
workflow provides the port, named runs, and its type names the workflow, so the Graph map draws a wire from every
caller to the workflow it runs. Calling the port runs the workflow in the caller, the same as calling the workflow
itself. BestBuds' social projection reads the formation candidates this way:
private val eligible by consumes(OnboardingFlow.forIsland(graph.label).candidates)
val members = eligible(Pooling(this, limit))
An actor's transition can run an inline workflow too. The workflow is declared next to the actor and the transition calls it, so its steps run inside the transition and inside any transaction the actor's store holds. The circle lifecycle advances a circle this way: the rounds, the reveals, the picks, their resolution and the wrap are steps of one inline workflow, and they run while the lifecycle holds the lock on the circle's row.
Runs and records#
work.start(workflow, input, key) writes a new record and arms the scheduler. The key names the run: starting again
with the same key and the same input returns the existing run, and a different input under that key throws
RunConflict. Keys have 1 to 512 characters without / or #, and inputs, results and signals are limited to 64 KB
each, so large data travels as a reference. work.execute(…) runs a run inside the calling process, which suits a
request handler. While the run only reads, it stays in memory and is written once, when it ends or starts to wait.
Before a step with any other effect, or a child run, it is written to the store, and from then on every change is
written as usual. Until it is written, record(), Hangar and signals do not see it.
A Run handle reads the record with record(), follows it with updates, returns the output with result() once
the run succeeded, delivers signals with signal(node, value) and asks for cancellation with cancel().
| Run state | Meaning |
|---|---|
Running | A step is running or ready to run. |
Waiting | Every open node waits for a signal, a timer or a child run. |
Blocked | A step with a side effect was interrupted and nothing can tell whether the effect happened. An operator reconciles or retries it. |
Compensating | A step failed or the run was cancelled, and Work is undoing the steps that succeeded. |
Succeeded, Failed, Cancelled | The run ended. |
Quarantined | The installed workflow no longer matches the one the run started with. |
Steps go through Pending, Running or Waiting, and end as Succeeded, Failed, Skipped, TimedOut or
Cancelled. Unknown marks an interrupted side effect, and Undoing and Undone belong to compensation.
Steps, leases and retries#
The executor claims a ready step by writing Running, the next attempt number, a new fence and a lease into the
record. The lease lasts the step's timeout plus 30 seconds, and the scheduler is armed for its end before the body
starts, so a process that dies mid-step leaves a wake-up behind. Work runs up to four step bodies at a time. When an
attempt ends, Work writes its outcome only if the record still holds that attempt's fence, so an attempt whose lease
was taken over cannot overwrite the newer one.
A step's result is recorded once. Later steps read it from the record, and the body never runs again for that run.
Inside the body, StepScope gives effectKey, a SHA-256 of the scope, the run and the step that stays the same across
attempts, to pass to the remote side as an idempotency key; attempt; checkpoint(value) to save progress that the
next attempt reads as checkpoint; and fail(reason) to end the step as failed without a retry.
When an attempt throws, times out or loses its lease, the step's effect class decides what
happens. ReadOnly and LiveRead steps go back to Pending after 1 second and then 2 seconds, for at most three
attempts, and then fail. A step with any other effect may have changed something outside, so Work never repeats its
body blindly. With a reconcile function, the next attempt runs reconcile first: it returns the result if the
effect happened, or null to run the body again. Without one, the step becomes Unknown, the run is Blocked, and an
operator decides with Reconcile or Retry in Hangar.
Failure and undo#
When a step fails or times out and no condition handles it, or when someone cancels the run, Work compensates. Nodes
that were pending or waiting are cancelled, running steps are left to finish or to let their lease run out, and child
runs are cancelled. Then every succeeded step that has an undo function is undone, one at a time, the most recently
finished first. An undo gets the step's result and its effectKey, and it is retried up to three times. When nothing
is left to undo, the run ends as Failed, or as Cancelled when it was cancelled.
Waiting: signals, timers and child runs#
A signal opens as soon as its condition holds and waits for run.signal(node, value, sender). When the signal names a
sender requirement, the sender's auth context must satisfy it. A value that arrives before the signal opens is kept
in the record and used when it opens, and a second value for the same signal is refused. A timer waits from the moment
it opens, and the store's due index wakes the scope when it ends, whichever process holds the store then.
call, each and loop start child runs in the same scope, with ids derived from the parent run and the node. A
child is an ordinary run with its own record. When it ends it wakes its parent, and the parent's node takes the child's
result, or fails when the child did not succeed.
Changing a workflow#
Each workflow has a digest: a SHA-256 over its id, its output and the structure of every node, meaning names, kinds, inputs, conditions, effects and timeouts. Step bodies are not part of it, so fixing the code inside a step needs nothing special. A change to the structure changes the digest, and a run that started under another digest is quarantined with the reason, before any of its steps run under the new shape. Retry clears the quarantine once the installed workflow matches the run's digest again, for example after a rollback.
Stores#
WorkStore is the contract: admit a run, read it, replace it only if it still has the revision you read, list what
is due, page through runs, follow one run, and read the journal. ObjectWorkStore implements it on the
Data layer's ObjectDatabase. Each run is one JSON record under its scope, and every change to a
record is written to a journal in the same transaction. The due index is a projection of that journal, kept with a
durable cursor, so finding due work reads a small index. The journal also serves Hangar's history view and any
consumer that reads it with events and acknowledge.
Each journal event names what changed: RunTransition.State(previous, current) when the run's state moves, and
RunTransition.Step(path, previous, current, attempt) when a step's state or attempt moves. These match the kernel's
state and progress run events. A change leaves the journal once every consumer's cursor has passed it and it is
older than the store's retention, which is 7 days unless set. Duration.INFINITE keeps every change.
| Platform | Database | Opened with |
|---|---|---|
| JVM desktop, Android, iOS | SQLite | SqliteObjectDatabase(driver, name, journalStorePrefix = ObjectWorkStore.JOURNAL_PREFIX) |
| JVM servers | PostgreSQL | PostgresObjectDatabase(dataSource, name, ObjectWorkStore.JOURNAL_PREFIX) |
| Cloudflare Workers | D1 | The D1 object database in reaktor-cloudflare, with the same journal prefix |
| Browser | SQLite on OPFS in a dedicated worker | BrowserObjectStore from reaktor-db |
The PostgreSQL journal takes a transaction-scoped advisory lock before it writes, so journal sequence numbers follow commit order and a reader that resumes from a sequence never skips a change.
Hosts and wake-ups#
A host gives Work two things. A WorkScheduler keeps one wake-up per scope and is armed with the next due time each
time a run changes. A WorkHost opens a session for a scope when the wake-up fires, and the session drains whatever is
due. The scheduler only decides when the process runs. What runs, and in which order, comes from the store.
| Host | Scheduler | Store | Proof |
|---|---|---|---|
| Hangar host | LiveScheduler, a coroutine timer in the host process | SQLite file per workspace | Passed 6 Nov: a run started before a host restart finished in the new process, its timer on time. A test cancelled a run on this host through an approved plan. |
| JVM server | QuartzWorkScheduler on Quartz's clustered JDBC store | PostgreSQL | Passed 6 Nov: server A was killed with SIGKILL mid-step; server B's Quartz recovered A's job and B finished the run on attempt 2. |
| Cloudflare Workers | CloudflareWorkflowHost, one Cloudflare Workflows instance per run | the instance's recorded steps, mirrored to D1 | Passed 6 Nov under workerd: a step failed twice and succeeded on its third attempt, the run slept 2 seconds, took a signal and survived a restart of workerd, and no attempt ran twice. |
| Browser | BrowserWorkScheduler, a timer under a Web Lock per scope; a service worker relays sync, periodicsync and push to an open page | SQLite on OPFS | Passed 6 Nov under headless Chromium: two tabs shared a run without running a step twice, a reload resumed a run, and a service-worker sync event drained due work. |
| Android | AndroidWorkScheduler, unique WorkManager work for the next wake-up | SQLite | Passed 6 Nov on a Samsung SM-S918B: a run with a timer survived a force-stop and finished about 2.5 seconds after the app relaunched. In a second proof the phone was rebooted while a run waited on its timer; once the phone was unlocked, the app finished the run in a background launch about 20 seconds later. |
| iOS | DarwinWorkScheduler: LiveScheduler while the app is active, a BGProcessingTask in the background | SQLite | Passed 6 Nov on an iPhone 14 Pro: after the app was killed, its run finished about a second after relaunch. In a second proof the app was killed while its run waited on a timer; iOS launched the app in the background, as the app recorded at launch, and the run finished in that launch 5 minutes after the timer fell due. |
On Cloudflare the Workflows instance owns the run, and the D1 copy serves queries. Replay drives the instance from
its recorded steps: each attempt is a step.do named by the step and its attempt, each wait is a step.waitForEvent
with a deadline, and each reading of the clock is recorded too. The code between steps therefore computes the same
thing every time Cloudflare runs it again, which is what Workflows requires. Signals and cancellation reach the
instance as events.
The first measurements come from debug builds and are not benchmarks. A hundred runs of a three-step workflow, 300 steps in all, take 291 ms on the JVM on an M4 Pro Mac (about 1,030 steps a second), 476 ms in Kotlin/JS (about 630), 963 ms on the iPhone 14 Pro (about 310) and 2,725 ms on the SM-S918B (about 110).
| Host | From a timer falling due to its next step starting |
|---|---|
Hangar host, LiveScheduler | 3 to 12 ms over three runs |
| JVM server, Quartz with an in-memory job store | 5 to 6 ms over two runs |
| iOS, app active | 11 ms |
| Browser | 16 ms with two tabs open, and 17 ms after a reload |
| Cloudflare Workers, under workerd | 69 ms |
| iOS and Android, relaunched after a kill | about 1 second and about 2.5 seconds from launch |
| iOS, killed, then launched by iOS in the background | 5 minutes |
QuartzWorkScheduler takes any Quartz Scheduler. Its drain job is marked @DisallowConcurrentExecution and requests
recovery, so in a cluster one server drains a scope at a time and a dead server's drain is picked up by another. The
server proof runs Quartz with JobStoreTX, PostgreSQLDelegate and isClustered=true. It needs Quartz 2.5.2 or
later, because 2.5.1 matches column names case-sensitively and so fails to load every trigger from PostgreSQL's
lowercase columns.
Inspection and control#
WorkInspector is a graph node beside Work that answers a WorkQuery for one exact host activation. The RUNS view
pages through runs, filtered by workflow, state or run id; DEFINITIONS lists the installed workflows with each node's
kind, types, inputs, conditions, effect and the nodes its condition reads; HISTORY pages through the journal. Reads
need the work.inspect.metadata permission, and inputs and results need work.inspect.payload.
WorkController applies Cancel, Retry and Reconcile. Each command names the revision it was decided on and needs
work.control.cancel, work.control.retry or work.control.reconcile; Retry and Reconcile also need the workflow's
operatorRetry. Auth describes how these permissions are granted.
Hangar's Cloud pane has a Work subpane. It lists the connected hosts, which are the phones linked through
DevTools and Hangar's own host, then a host's runs. A selected run is drawn on its workflow's
graph with the same map as Hangar's Graph pane: each step is a card with its ports, its state and its attempt, and a
step that waits on a condition reads, for example, "when charge failed". Beside it, an inspector shows the run's reason,
its next wake-up and the controls that apply, and "Show this run on the graph" opens the Graph pane on the workflow,
whose card lists its steps with their states and follows the run live.
Hangar sends a control to a phone as the kernel device operation work-control and checks that the phone's receipt
matches the command. A control for a run on Hangar's own host becomes a pending plan in the kernel, and the host
applies it once someone approves that plan in Hangar. Coding agents read the same data through the
kernel operations work.hosts and work.inspect, and work.start starts runs on Hangar's host.
What it improves#
| Usual approach | What goes wrong | Reaktor's approach |
|---|---|---|
| Calling WorkManager, BGTaskScheduler or a server's job scheduler directly | Each platform has its own API and limits. A job of several steps keeps its progress in ad-hoc flags, and after a crash nobody can tell which step ran. | One workflow runs on every platform. Each step's state and result are in the record, and the platform API only wakes the process. |
| A hosted workflow engine such as Temporal, Step Functions or Cloudflare Workflows | It needs a server or a cloud account, and it does not run on a phone or in a browser. Temporal also replays workflow code, so that code must stay deterministic. | Work runs inside the app's own process, on its own database, on every Reaktor target. Results are recorded and read back, so only the workflow's shape is fixed. |
| Retrying every failed job | A payment or an email that was sent before the crash is sent again. | Only reads retry by themselves. Steps with side effects reconcile first or wait for an operator, and effectKey gives the remote side a stable idempotency key. |
| Reading logs to find a stuck job | The state of a job is spread over log lines on several machines. | Hangar draws each run on its workflow's graph, with the reason it is waiting or blocked and the controls that apply. |
Limitations#
- The platform decides when. Android and iOS run background work when they choose, and iOS can defer it for hours.
Work guarantees that a run continues at the next wake-up, not when that comes.
LiveSchedulerwakes only while its process runs. - One version of a workflow per scope at a time. A rolling deploy that runs two shapes of a workflow side by side quarantines the runs the older hosts touch. Deploy every host of a scope together, then retry what was quarantined.
- Compensation stops at child runs. A child run that succeeded is not undone when its parent compensates, and a quarantined child leaves its parent waiting.
- Listing scans.
page()reads every record of a scope, so the Runs view slows down with many thousands of runs. The due index does not have this cost. - A stalled consumer holds the journal. A change is pruned only after every consumer's cursor has passed it, so a consumer that stops reading keeps every later change, and no call removes a consumer yet.
- Workers runs no child runs. The Cloudflare Workflows host refuses workflows with
call,eachorloop, and a step's checkpoint is not durable there. - The service worker needs a page. It relays a wake-up to an open page, which drains. With no page open, due work waits until a page opens.
- Results stay small. Inputs, results and signals are limited to 64 KB, and up to four step bodies run at once in one process.
- An inline run keeps nothing. When the process dies during an inline run, no record says which steps ran, and nothing retries or undoes them. A flow that must finish after a crash belongs in a durable run.
Reference#
| Package | What it holds | Main files |
|---|---|---|
graph.step, in reaktor-graph-runtime | Inputs, steps, either, conditions, step states, the readiness rule, definition checks, the run overlay and inline runs. | Steps.kt, Output.kt, Condition.kt, Ready.kt, StepChecks.kt, StepState.kt, RunShape.kt, Inline.kt |
work.definition | Durable, the waits and child runs (signal, timer, call, each, loop) and the plan with its digest. | Durable.kt, Declarations.kt, Output.kt, WorkflowPlan.kt |
work.run | Run and step records, transitions and scopes. | RunRecord.kt, RunTransition.kt, WorkScope.kt |
work.execution | The planner, the executor, retries, request mode, the Workers interpreter and the scheduler contract. | Planner.kt, Executor.kt, Attempts.kt, Outcome.kt, RequestStore.kt, Replay.kt, WorkScheduler.kt |
work.store | The store contract and its ObjectDatabase implementation. | WorkStore.kt, ObjectWorkStore.kt |
work.host | Host sessions, the coroutine timer and the platform schedulers. | WorkHost.kt, LiveScheduler.kt, android/, ios/, browser/, cloudflare/, quartz/ |
work.inspection | Queries, pages and controls for Hangar and the kernel. | WorkInspector.kt, WorkInspection.kt, WorkControl.kt |
The code is in reaktor/reaktor-work, with Work.kt at the root of the package. Steps live in reaktor-graph-runtime,
so Hangar's Graph map reads a workflow with the same code that runs it. WorkConformance holds the 23
checks every store and host must pass, and ReplayConformance holds 9 more for the Workers interpreter. They run on
SQLite on the JVM, through the browser's SQLite worker protocol in Kotlin/JS, with AndroidSqliteDriver on an Android
phone and with NativeSqliteDriver on an iPhone. QuartzPostgresClusterTest runs the server proof when
REAKTOR_WORK_TEST_JDBC_URL names a disposable PostgreSQL database, and WakeLatencyTest measures the desktop and
Quartz wake-ups. In reaktor-cloudflare, D1WorkStoreTest runs the D1 store, journal pruning included, and
CloudflareWorkflowsTest the Workers proof under workerd. InlineTest in reaktor-graph-runtime covers inline runs,
and workflows consumed through ports, on the JVM and in Kotlin/JS. In BestBuds, KernelWorkTest covers Hangar's host, its restart and its controls, and
work.spec.ts runs the browser proof under headless Chromium.
- Data layer covers
ObjectDatabaseand its SQLite, PostgreSQL, D1 and browser implementations. - Services defines the effect classes that steps declare.
- Auth covers requirements, permissions and auth contexts.
- DevTools covers the link that carries phone runs to Hangar.
- Hangar covers the desktop app and its Cloud pane.