NAME

Azure::SDK::Core::Pipeline - ordered policy pipeline for the Perl Azure SDK core

SYNOPSIS

my $pipeline = Azure::SDK::Core::Pipeline->new(
    policies  => [ $headers_policy, $retry_policy, $credential_policy ],
    transport => $transport,
);

my $response = $pipeline->send($context, $request);

DESCRIPTION

Azure::SDK::Core::Pipeline runs a request through an ordered list of policies, ending at the transport. The policy list is plain and explicit: the first policies are per-call, the retry policy is the per-try boundary, and the policies after it are re-run on every attempt because the retry policy invokes its continuation more than once.

The pipeline composes the policies into a chain of $next continuations so each policy is called as $policy->send($context, $request, $next) and the innermost continuation calls $transport->send($request).

CONSTRUCTOR

new

Named parameters:

policies

Optional arrayref of policy objects in execution order. Defaults to an empty arrayref.

transport

Required transport implementing send($request).

METHODS

send

my $response = $pipeline->send($context, $request);

Runs the request through the policy chain and returns the resulting Azure::SDK::Core::Response.

SEE ALSO

Azure::SDK::Core::Policy, Azure::SDK::Core::Transport