Skip to content

LegionIO/lex-tasker

lex-tasker

Task lifecycle manager for LegionIO. Manages the full lifecycle of tasks within the framework: status tracking, subtask relationships, delayed task scheduling, task logging, and extension registration.

This is a core LEX required for task execution.

Installation

gem install lex-tasker

Functions

  • CheckSubtask - After a task completes, find all relationship-linked subtasks and dispatch them (with delay, condition, or transformation routing as appropriate)
  • TaskManager - DB housekeeping: purge old completed tasks, expire stale queued tasks
  • FetchDelayed - Poll for tasks in task.delayed status; dispatch when their delay period has elapsed
  • Updater - Update task records (status, function args, payload, results)
  • Log - Task activity log CRUD (add, delete by task/node/id, delete all)

How It Works

When a task completes, its runner calls check_subtasks via the task exchange. lex-tasker looks up any configured relationships for that function, creates child task records in the database, and publishes them to the appropriate queue - routing through lex-conditioner, lex-transformer, or directly to the target runner depending on relationship configuration.

Delayed tasks (those with relationship_delay or task_delay) are stored in the database with status task.delayed and dispatched by the FetchDelayed runner once their delay period has elapsed.

Standalone Client

Legion::Extensions::Tasker::Client provides access to the TaskFinder helper for programmatic task lookup:

require 'legion/extensions/tasker/client'
client = Legion::Extensions::Tasker::Client.new

Accepts an optional data_model: kwarg to inject a mock data model for testing.

Requirements

  • Ruby >= 3.4
  • LegionIO framework
  • legion-data (database persistence required)

License

MIT

About

No description or website provided.

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE
MIT
LICENSE.txt

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors