Skip to main content

Crate vertep_runtime

Crate vertep_runtime 

Source
Expand description

Event-sourced actor runtime for Vertep.

A chart becomes a durable actor: addressed by an IRI, fed through a mailbox, run one SCXML macrostep per turn by the pure vertep_core::session::step, and made durable by appending one journal entry per turn to a vertep_store::JournalStore with compare-and-set. The runtime is an imperative shell around that pure core: it owns time (shell::Clock), background work (shell::Spawn) and waiting (shell::Sleep), all injectable, so tests run on a virtual clock.

  • node: the scheduler of one process: virtual actors (activated on message, deactivated when idle, at most one activation per node), invoked actors (<invoke> children with vt:restart supervision), stateless worker pools, the transactional outbox, durable timers, snapshots, replay, migrations, forks and time travel.
  • machine: the deterministic macrostep used by live turns and replay alike.
  • journal: journal entries as RDF datasets in vt: terms.
  • mailbox, transport: pluggable mailboxes (in-memory, store-backed), transports registered as SCXML Event I/O Processors, and the directory of resolvers.
  • actor: the actor contract and its chart, function and stream adapters.
  • chart: chart versions, the registry, vt: extension lowering and migrations.
  • ontology: the runtime ontology module and its SHACL shapes.
  • placement: the hook a cluster uses to place virtual actors and workers on nodes.
  • websocket: the WebSocket Event I/O Processor’s frames and links, and its server end (feature websocket).

@tg: implements:: [[decisions#SCXML-native actors with vt extensions]] @tg: implements:: [[decisions#IRI identity and lifecycle classes]] @tg: implements:: [[decisions#Identity, mailbox and transport layers]] {confidence: partial, note: “local transport only; DID and relay mailboxes are M5”} @tg: implements:: [[decisions#Event-sourced actors]] @tg: implements:: [[decisions#Content-addressed chart versions]] @tg: implements:: [[decisions#No-std core and tokio shell]] @tg: implements:: [[decisions#Non-blocking request and deferred events]] @tg: implements:: [[decisions#State changes travel in the append]] @tg: implements:: [[decisions#Fencing epochs on journal appends]] {confidence: partial, note: “the configured token is passed on every append; leases are M4”}

Re-exports§

pub use actor::Actor;
pub use actor::ActorFactory;
pub use actor::ActorFailure;
pub use actor::ActorFn;
pub use actor::ActorInput;
pub use actor::ActorStart;
pub use actor::ChartActor;
pub use actor::FnActor;
pub use actor::OutTarget;
pub use actor::Outgoing;
pub use actor::StreamActor;
pub use actor::Turn;
pub use actor::TurnOutput;
pub use address::Address;
pub use address::AddressError;
pub use chart::ChartInfo;
pub use chart::ChartRegistry;
pub use chart::Migration;
pub use chart::RegisterError;
pub use chart::UnhandledPolicy;
pub use journal::EntryBody;
pub use journal::EntryData;
pub use journal::TimerRecord;
pub use mailbox::Envelope;
pub use mailbox::Mailbox;
pub use mailbox::MailboxFactory;
pub use mailbox::MemoryMailboxes;
pub use mailbox::StoreMailboxes;
pub use node::ActivationError;
pub use node::ActorState;
pub use node::AskError;
pub use node::CrashPoint;
pub use node::DeadLetter;
pub use node::DeliveryError;
pub use node::MigrateError;
pub use node::Node;
pub use node::NodeBuilder;
pub use node::NodeConfig;
pub use node::NodeHandle;
pub use node::NodeStats;
pub use node::RemoveError;
pub use placement::Placement;
pub use placement::Route;
pub use shell::Clock;
pub use shell::Shell;
pub use shell::Sleep;
pub use shell::Spawn;
pub use shell::VirtualClock;
pub use storage::SplitStorage;
pub use storage::Storage;
pub use transport::LocalTransport;
pub use transport::Resolver;
pub use transport::Transport;
pub use vertep_rdf;
pub use vertep_store;

Modules§

actor
The actor contract and its adapters for charts, async functions and streams.
address
Actor addresses and the stable IRIs of runtime records.
chart
Chart versions, the chart registry, vt: extension lowering and migrations.
journal
Journal entries as RDF: what one turn records and how it is read back.
json
The JSON text encoding of datamodel values in journal entries, snapshots and dead letters.
machine
The deterministic part of a virtual actor: one macrostep from a journaled input to the effects its entry records, used identically by live turns and by replay.
mailbox
Mailboxes: where messages wait for an actor, independently of its activations.
node
A runtime node: activations, turns, the outbox, timers, supervision and migrations.
ontology
The vt: runtime ontology module and its SHACL shapes.
placement
The placement hook of a clustered node.
shell
The shell traits: the only way the runtime spawns work, reads time or waits.
storage
Where a node keeps journals and graphs.
transport
Transports and address resolution.
vocab
The vt: runtime terms, as declared by vertep-rdf/ontology/vt-runtime.ttl.
websocket
The WebSocket Event I/O Processor: the frames both ends speak and the delivery state of one peer link, shared by the browser shell (vertep-wasm) and the server endpoint ([server], feature websocket).