/skills:perl-io-async-futurefrom skills
Use when writing async Perl — IO::Async, Future, Future::AsyncAwait, Net::Async::*, futures lost to GC, cancellation, requests that hang.
Ships in skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
PEVANS-style async Perl. The framework is small, but its lifetime rules are unforgiving: a Future that nobody holds is garbage-collected mid-flight, and the symptom is rarely a clear error.
You MUST retain every Future you care about until it is ready.
A Future is a handle to a result that may not exist yet, and also a plain Perl object
with a refcount. When the last reference drops it is destroyed — even while it stands
for an in-flight operation. The op may continue, complete into the void, or wedge;
nobody hears about it. With Future::AsyncAwait you see:
Suspended async sub Foo::bar lost its returning future
The async sub's continuation was destroyed mid-flight. Without async/await you see nothing — a hang, or a callback that never fires.
# ❌ BUG: $f is local to the closure, GC'd as soon as _reconnect returns
sub _reconnect {
my $self = shift;
my $f = $self->loop->delay_future(after => 2)->then(sub { $self->connect });
}
Hold it in one of three ways:
$self->{_some_future}, or any container that outlives
the operation. Store the whole chain, not just the leaf. When a caller drops an
async sub's Future, the cure is the caller storing it — the async sub does not retain
its own returning Future, and adding ->retain inside it is not the fix.await, or ->get in sync code) before the sub returns.->retain — rare; only for true fire-and-forget, when you need the op to
finish but genuinely don't need its result. Otherwise hold the Future yourself.$self->_log_async($msg)
->on_fail(sub { warn "log failed: $_[0]" })
->retain;
->retain makes the Future hold itself (a reference cycle) until it completes, then
lets go. Without it this chain has no holder and is destroyed before it runs.
Nearly every async bug is one of three: nobody held the Future; something held it too
tightly through a captured $self; or it was held but never deleted and now blocks the
next operation.
$self in callbacks of a chain stored on $self:
weaken(my $weak = $self) (from Scalar::Util), then my $self = $weak or return;
inside each callback. A strong capture keeps the object alive forever; reconnect loops
leak.on_done and on_fail. A stale
$self->{_reconnect_future} trips guards like return if $self->{_reconnect_future}
and blocks every later attempt.delete it from $self, then
$f->cancel unless $f->is_ready.configure: delete your keys from %params, then always chain
$self->SUPER::configure(%params). Leftover keys throw configure_unknown; skipping
the chain leaves defaults silently missing and unknown keys silently accepted.$self->loop is undef until $loop->add($notifier). Anything that calls it must
run after the add.async sub, write return await $f, never return $f — returning a Future
double-wraps the result.then chains, on_done observes. then returns a new Future, and its callback
returns a Future to chain — use it for control flow. on_done/on_fail return the
same Future and discard the callback's return value — use them for side effects. A
"chain" of on_done calls is really parallel observers of the original Future.require IO::Async::Internals::Connector
(and IO::Async::SSL for https) in an eval and fail with the module name.configure vs new, child notifiers, $loop->new_future,
running the loop, ->get in scripts, IO::Async::Test:
references/notifier.md_connect_future
on disconnect, the Net::Async::HTTP hang in full:
references/connect-reconnect.mdthen/else, needs_all, wait_any, also =>, timeouts, cancellation rules, a
decision guide: references/composition.mdasync sub/await example, @_ across await, await in map/grep:
references/async-await.mdWhat SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (getty/skills) — no native marketplace selected
npx claudepluginhub p/getty-skills129 skills in this plugin
/ai-playable-gamesUse when building a game or simulation that bots or LLM agents must play — observation and order interface, agent API or MCP server, AI seats beside humans, fog of war, replays; or when an AI player cheats, stalls, misreads the state or follows text other players wrote./ai-web-scrapingUse when scraping, crawling or extracting structured data from websites, especially with an LLM — Crawl4AI, Firecrawl, Scrapy, Crawlee, Playwright, browser-use; building a dataset or RAG corpus, watching pages for changes, or a scraper that returns empty, duplicated or invented records./cedar-engineeringUse when writing, validating or debugging Cedar authorization policies — .cedar and .cedarschema files, permit/forbid, entities and hierarchies, RBAC/ABAC/ReBAC, templates, multi-tenant access, partial evaluation, Amazon Verified Permissions, migrating to or from Cedar.Other plugins' skills for the same job