Quick actions

cmd+k|ctrl+k

Navigation

Languages

Untitled

Snippet info

Language

Raku

Visibility

public

Author

rightfold

Created

2020-03-31T16:55:42Z

Updated

2020-03-31T16:55:42Z

multi sub handle-request(|) { * }

multi sub handle-request(Str:D $raw-request)
{
    try {
        my %rare-request;
        my $command      := %rare-request<command>;
        my $retry-max-n  := %rare-request<retry-max-n>;
        my $retry-max-t  := %rare-request<retry-max-t>;
        handle-request($command, $retry-max-n, $retry-max-t);
        note 'hi';
    }
    my %rare-response :=
        $! ?? {status => ‘error’, error => ~$!}
           !! {status => ‘ok’};
    %rare-response;
}

multi sub handle-request(Str:D $command, Int:D $retry-max-n, Int:D $retry-max-t --> Nil)
{
    note 'bye';
}

say handle-request(‘’);
INFO