← ClaudeAtlas

boxlang-core-dev-async-taskslisted

Use this skill when working with BoxLang asynchronous programming: BoxFuture (CompletableFuture extension), AsyncService, executor types (VIRTUAL/FIXED/CACHED/SCHEDULED), BaseScheduler, ScheduledTask fluent API, scheduling with cron constraints, task lifecycle callbacks, and registerring schedulers via ModuleConfig.bx.
ortus-boxlang/skills · ★ 0 · AI & Automation · score 58
Install: claude install-skill ortus-boxlang/skills
# BoxLang Async & Scheduled Tasks ## Overview BoxLang provides first-class async support built on JRE 21 virtual threads and `CompletableFuture`. Key classes: | Class | Package | Purpose | |---|---|---| | `BoxFuture<T>` | `ortus.boxlang.runtime.async` | Extended `CompletableFuture` | | `AsyncService` | `ortus.boxlang.runtime.services` | Executor and future factory | | `BaseScheduler` | `ortus.boxlang.runtime.async.tasks` | Extend to create a scheduler | | `ScheduledTask` | `ortus.boxlang.runtime.async.tasks` | Fluent scheduled task builder | | `BoxExecutor` | `ortus.boxlang.runtime.async.executors` | Thead pool wrapper | ## AsyncService — Executor Factory ```java import ortus.boxlang.runtime.services.AsyncService; import ortus.boxlang.runtime.async.executors.BoxExecutor; import ortus.boxlang.runtime.async.BoxFuture; AsyncService asyncService = BoxRuntime.getInstance().getAsyncService(); // Create executors BoxExecutor virtualExec = asyncService.newExecutor( "myPool", ExecutorType.VIRTUAL ); // Virtual threads (default) BoxExecutor fixedExec = asyncService.newExecutor( "myFixed", ExecutorType.FIXED, 4 ); // Fixed 4-thread pool BoxExecutor cachedExec = asyncService.newExecutor( "myCached", ExecutorType.CACHED ); // Cached thread pool BoxExecutor scheduledExec = asyncService.newScheduledExecutor( "myScheduled" ); // For scheduled tasks // Get an existing executor BoxExecutor exec = asyncService.getExecutor( "myPool" ); // Check existence boolean ex