NAME
PAGI::Nano::ServiceRegistry - The per-app registry backing PAGI::Nano's service keyword
DESCRIPTION
One instance is created per assembled PAGI::Nano app that declares any service. It is never constructed directly by application code; it is the object passed to every service builder (as $app in the service examples) and the object $c->service resolves against at request time.
METHODS
service
my $value = $app->service('name');
Returns an already-built service, for use inside another service's builder (composition). Services build eagerly, in declaration order, at lifespan startup; asking for one declared later in the same app { } block (or not declared at all) croaks, naming the service.
A test that wants to read an app-scoped service without issuing a request does not reach this object directly (it is private); it uses the PAGI::Nano::resolve_service($app, $name) seam, which resolves against this registry after lifespan startup. See "resolve_service" in PAGI::Nano.
SEE ALSO
PAGI::Nano, PAGI::Nano::Context.
AUTHOR
John Napiorkowski <jjnapiork@cpan.org>
COPYRIGHT & LICENSE
Copyright 2026, John Napiorkowski. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.