Skip to main content

journio_core/
lib.rs

1//! # journio-core
2//!
3//! Pure-Rust port of the core engine of `journio-transact-golang`.
4//!
5//! This crate defines the *erased, object-safe traits* that the runtime,
6//! the Postgres/SQLite backends, and the Python/Node bindings all build on.
7//! There is intentionally no I/O here beyond trait definitions — concrete
8//! backends live in `journio-postgres` / `journio-sqlite`.
9//!
10//! Porting source: `journio/journio.go`, `journio/workflow.go`, `journio/dialect.go`,
11//! `journio/errors.go`, `journio/serialization.go`, `journio/system_database.go`,
12//! `journio/client.go`.
13//!
14//! Status: the core runtime path and workflow primitives (durable `Sleep`,
15//! `Send`/`Recv`, `SetEvent`/`GetEvent`, `RunWorkflow`/`RunAsStep`, recovery/
16//! replay) are implemented, alongside queues, scheduler, streams, debouncer,
17//! patching, and the standalone `Client`. The SQLite and Postgres backends
18//! (`journio-sqlite`, `journio-postgres`), the CLI (`journio-cli`), the admin
19//! HTTP server (`journio-admin`), and the Node.js bindings are provided as
20//! sibling crates. Remaining: the conductor and further language bindings.
21
22// `JournioError` carries its context fields by value and exceeds clippy's
23// 128-byte `result_large_err` threshold; boxing it in `JournioResult` would be
24// a cascading public-API break for marginal gain.
25#![allow(clippy::result_large_err)]
26
27pub mod client;
28pub mod config;
29pub mod context;
30pub mod dialect;
31pub mod error;
32pub mod system_db;
33pub mod types;
34pub mod value;
35pub mod workflow;
36
37pub use client::{Client, ClientScheduleInput};
38pub use config::Config;
39pub use context::{
40    DebounceOptions, EnqueueOptions, ForkWorkflowOptions, JournioContext, QueueOptions,
41    ReadStreamOptions, ScheduleOptions, WorkflowContext, WorkflowHandle,
42};
43pub use dialect::{Dialect, DialectName};
44pub use error::{JournioError, JournioErrorCode};
45pub use system_db::{ForkWorkflow, InitWorkflow, InitWorkflowResult, Notification, SystemDatabase};
46pub use types::{
47    ListWorkflowsFilter, QueueConfig, ScheduleStatus, ScheduledWorkflowInput, StepRecord,
48    StreamEntry, VersionInfo, WorkflowSchedule, WorkflowStatus, WorkflowStatusType,
49};
50pub use value::{Interchange, JsonSerializer, Serializer};
51pub use workflow::{Registry, Step, StepFunc, Workflow, WorkflowFn};