WJb Docs - Basic

Start here with installation, quick starts, and core concepts.

πŸš€ Start Here
✨ First Steps
βœ… Next Steps

πŸ“¦ First Job

A Job is a request to execute an Action.

You create a Job by enqueueing it.


Enqueue a Job

await wjb.EnqueueAsync("greet", "Alice");

What this does

  • "greet" β€” the action key we registered earlier
  • "Alice" β€” the input that will be passed to the Action
The job is now stored and waiting to be executed.

Run the Job

await wjb.ExecuteOnceAsync();

This tells the worker to:

1. Take the next available job 2. Execute the corresponding Action 3. Save the result


Full example

using WJb;

public sealed class GreetAction : JobAction<string> { public override Task<IActionResult> ExecuteAsync( string name, CancellationToken ct) { Console.WriteLine($"Hello, {name}!"); return CompleteAsync(); } }

var store = new InMemoryStore();

var wjb = WJbBuilder.Create(store, cfg => { cfg.AddAction<GreetAction>("greet"); }) .Build(store);

// Create the job await wjb.EnqueueAsync("greet", "Alice");

// Execute it await wjb.ExecuteOnceAsync();


What just happened?

1. We created a Job for the greet Action. 2. We passed "Alice" as input. 3. The worker executed the Action. 4. The Action printed the message and completed.

An unhandled error has occurred. Reload πŸ—™

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.