NAME
Hypersonic::Future::Pool - Thread pool for async operations
SYNOPSIS
use Hypersonic::Future::Pool;
use Hypersonic::Future;
# Initialize pool
Hypersonic::Future::Pool->init;
# Submit work
my $f = Hypersonic::Future->new;
Hypersonic::Future::Pool->submit($f, sub {
# This runs in the main thread when worker signals ready
return expensive_computation(@_);
}, [$arg1, $arg2]);
# Process completed work (in event loop)
my $fd = Hypersonic::Future::Pool->get_notify_fd;
# When fd is readable:
Hypersonic::Future::Pool->_process_ready;
# Cleanup
Hypersonic::Future::Pool->shutdown;
DESCRIPTION
Hypersonic::Future::Pool provides a thread pool for offloading blocking operations. Worker threads signal completion via eventfd (Linux) or pipe (macOS/BSD), and the actual Perl code execution happens in the main thread to avoid Perl interpreter threading issues.