Crate apalis_board_api

Crate apalis_board_api 

Source
Expand description

§apalis-board

apalis-board


apalis-board provides utilities for building web interfaces and apis for managing apalis backends.

Key features:

  • Visualize your queues and jobs in real time
  • Beautiful UI to track job status and progress
  • Perform actions on jobs directly from the dashboard
  • Gain insights into queue health and worker activity
  • Easily integrate with existing apalis-based services
  • Streamline job management and debugging

Get a clear overview of what’s happening in your queues and manage jobs efficiently.

§Crates

§Usage

Each version of apalis-board includes a compatible version of the ui.

apalis-board = { version = "1.0.0-rc.2", features = ["actix"] } #Or axum

Here are the basics of setting up the board:

App::new()
    .service(
        ApiBuilder::new(Scope::new("/api/v1")) // Setup the mount
            .register(notification_store) // Add backends
            .register(email_store)
            .build(), // Build the routes an
    )
    .service(ServeApp::new()) // Serve the frontend

§Including Realtime tracing events

let broadcaster = TracingBroadcaster::create();

let tracing_subscriber = TracingSubscriber::new(&broadcaster);
let tracing_layer = tracing_subscriber.layer()
    .with_filter(EnvFilter::builder().parse("debug").unwrap());


tracing_subscriber::registry().with(tracing_layer).init();

/// Then register the broadcaster
App::new()
    .app_data(broadcaster.clone())

If you visit /api/v1/events you will receive the task logs. This is also accessible on the /logs page in the board.

§Leptos integration

If you are working on a leptos UI and want to embed the web interface in part of in full, then you can import the web functionality:

apalis-board = { version = "1.0.0-rc.2", features = ["web"] }

§Support

SourceCrateSupport
apalis-cron
apalis-redis⚠️
apalis-sqlite
apalis-postgres
apalis-mysql
apalis-amqp⌛⚠️
apalis-rsmq
apalis-pgmq
apalis-file-storage⌛⚠️

§Screenshots

§Tasks

Tasks

§Single Task

Tasks

§Workers

Workers

§Queues

Queues

§Building the frontend

cd crates/web
trunk build

§Examples

  • axum-email-service : Basic example that shows how to send emails via smtp using lettre and axum
  • actix-ntfy-service : Basic example that shows how to publish notifications using ntfy.sh and actix

§Acknowledgments

The following repos were referenced in building the frontend

Modules§

framework
Contains different web framework routes.
sse
Expose Server-Sent Events (SSE) functionality.
ui
Expose UI components and functionality.

Functions§

fetch_queues
Fetch all queues.
get_all_tasks
Get all tasks across all queues.
get_all_workers
Get all workers across all queues.
get_task_by_id
Get a task by its ID.
get_tasks
Get a list of tasks from the specified queue with filtering options.
get_workers
Get workers for a specific queue.
overview
Get an overview of statistics.
push_task
Push a new task to the specified queue.
stats_by_queue
Get statistics for a specific queue.