WJb Docs - Basic

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

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

πŸ‘‹ Hello WJb

This is the fastest way to see WJb in action.

We will create the simplest possible job and run it.


1. Create a simple Action

using WJb;

public sealed class HelloAction : JobAction<object> { public override Task<IActionResult> ExecuteAsync( object input, CancellationToken ct) { Console.WriteLine("Hello from WJb!"); return CompleteAsync(); } }


2. Set up WJb

using WJb;

var store = new InMemoryStore();

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


3. Enqueue and run the job

await wjb.EnqueueAsync("hello", null);

// Run the worker once await wjb.ExecuteOnceAsync();


Full example

using WJb;

public sealed class HelloAction : JobAction<object> { public override Task<IActionResult> ExecuteAsync( object input, CancellationToken ct) { Console.WriteLine("Hello from WJb!"); return CompleteAsync(); } }

var store = new InMemoryStore();

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

await wjb.EnqueueAsync("hello", null); await wjb.ExecuteOnceAsync();


What just happened?

1. We created an Action. 2. We registered it. 3. We enqueued a job. 4. The worker executed the Action. 5. The Action completed the workflow.

No pipelines. No middleware. No magic.

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.