Documentation / Start

How Troolio works

Troolio helps you represent a business action as a command, record its outcome as an event, and answer questions from state rebuilt from those events. It runs on Microsoft Orleans actors. You can start with one actor and add projections or provider adapters as your application grows.

On this page

One actor, four ideas

A command is handled by an actor, stored as an event, and replayed into state for queries.

In the first actor, these two methods make the relationship concrete:

public IEnumerable<Event> Handle(Increment command) =>
    [new Incremented(command.Headers)];

public void On(Incremented _) => count++;

The first method decides an event; the second applies it to state. Keep On free of network or provider calls so replay is safe.

What readers and outside systems see

A projection consumes committed events to build a read model. It can lag behind the command result. An external action, such as a reminder or notification, needs a durable effect intent and a provider that deduplicates retries.

A committed event hands off work to a projection and, separately, to an idempotent effect provider.

Projections and external effects explain the two paths.

Choose a command path

For a first app, learn the ordinary actor path and configure a suitable store. For an operation whose participants, projection handoffs, and completion evidence must commit together, explicitly select the atomic command route. That route requires a compatible store, current route authority, and recovery plan; a package reference does not activate it.

Where to go next

  1. Model a command and rule with an accepted and rejected outcome.
  2. Build the first actor, then configure the host.
  3. Explore events and state, stores, and read models.
  4. For advanced routes, follow atomic commit, route authority, and recovery.

Continue into an application

Follow the workshop workflow to connect two actors, orchestration, a SQL projection, and an authorized reader. Learn message metadata to understand correlation, causation, user, device, message, and transaction IDs.