boxlang-async-programming

Coordinate BoxLang futures, executors, and async primitives for non-blocking operations.

16|78|Updated Nov 28, 2014
One-click install
npx skills add https://github.com/ortus-docs/coldbox-docs --skill boxlang-async-programming
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: boxlang-async-programming
Source: https://github.com/ortus-docs/coldbox-docs/tree/main/.agents/skills/boxlang-async-programming
Command: npx skills add https://github.com/ortus-docs/coldbox-docs --skill boxlang-async-programming

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

BoxLang async constructs simplify building scalable, non-blocking logic by coordinating futures, executors, and async pipelines across IO and CPU tasks.

Core Features & Use Cases

  • BoxFuture extends standard futures with BoxLang-friendly chaining for ergonomic async flows.
  • Create futures with futureNew, run async tasks with asyncRun, and compose pipelines using then/thenAsync with robust error handling.
  • Build parallel and distributed workflows including asyncAll, asyncAny, asyncAllApply, and named executors to optimize resource usage.
  • Use cases include non-blocking API calls, parallel data processing, and scheduled task coordination within BoxLang apps.

Quick Start

Create a BoxLang workflow that demonstrates futureNew, asyncRun, and then chaining with then and onError.

Frequently Asked Questions about boxlang-async-programming

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle asynchronous operations and non-blocking API calls in BoxLang?

Asynchronous operations in BoxLang are handled using BoxFuture, which extends standard futures with chaining methods like then, thenAsync, and onError for ergonomic non-blocking API call workflows. You create futures with futureNew and execute tasks using asyncRun.

How do I run parallel data processing tasks in BoxLang?

Parallel data processing in BoxLang is executed using asyncAll, asyncAny, and asyncAllApply constructs. These async pipelines coordinate multiple futures across IO and CPU tasks, allowing scalable non-blocking logic execution.

What is the best way to manage error handling in BoxLang async workflows?

Error handling in BoxLang async workflows is managed by attaching onError callbacks to BoxFuture pipelines. This ensures reliable error capture alongside then or thenAsync chaining for robust async flow control.

Can I configure multiple executors for async tasks in BoxLang?

Multiple named executor configurations are supported in BoxLang to optimize resource usage for async tasks. Executors coordinate futures and async primitives, allowing tailored allocation for IO-bound non-blocking calls versus CPU-bound parallel workflows.

How do I schedule and coordinate tasks within BoxLang apps?

Scheduled task coordination within BoxLang apps is achieved by leveraging asyncRun and futureNew alongside executors. This combination allows reliable scheduling and non-blocking execution of distributed workflows.

Do I need any dependencies to use BoxLang async programming features?

No external dependencies are required to use BoxLang async programming features. The BoxLang runtime natively supports BoxFuture, futureNew, asyncRun, and executor configurations for building scalable async pipelines.