The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

KelpX::Symbiosis::Util - Reusable tools for Symbiosis

SYNOPSIS

        use KelpX::Symbiosis::Util;

        my $app = SomePlackApp->new;
        $kelp->routes->add(
                '/newapp/>',
                KelpX::Symbiosis::Util::plack_to_kelp($app->to_app),
        );

DESCRIPTION

These are some utilities helpful when Plack and Kelp are wrestling each other.

USAGE

Functions

None of the functions are exported, use them together with package name.

wrap

        my $wrapped = KelpX::Symbiosis::Util::wrap($obj, $app);

Wraps $app inside all the middleware declared in $obj, which should contain attribute middleware with contents loaded using "load_middleware".

load_middleware

        KelpX::Symbiosis::Util::load_middleware($obj, %config);

Loads standard Kelp middleware definitions into middleware attribute of $obj (adds to it, does not clear it). Can be used later with "wrap".

plack_to_kelp

Moved to core Kelp in version 2.10. This function will not be removed for backward compatilibity, but is now just an alias for "adapt_psgi" in Kelp::Util.