WJb Docs - Basic

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

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

⚑ First Action

An Action is the basic unit of work in WJb.

It receives input, does something useful, and returns a Result.


Create an Action

using WJb;

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

What this code does

  • Inherits from JobAction
  • Receives a string as input
  • Prints a greeting
  • Completes the workflow

Register the Action

var store = new InMemoryStore();

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

The string "greet" is the action key. You will use this key when enqueueing jobs.


Key points

  • One Action = one clear responsibility
  • Actions are normal C# classes
  • Input is strongly typed
  • The Result decides what happens next

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.