| 1 | package PAGI::Context::SSE; | ||||||||||||||||||||
| 2 | 28 | $PAGI::Context::SSE::VERSION = '0.002001'; | |||||||||||||||||||
| 3 | 28 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 28 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | 28 | our @ISA = ('PAGI::Context'); | |||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | # ── Underlying PAGI::SSE accessor ──────────────────────────────────── | ||||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | sub sse { | ||||||||||||||||||||
| 11 | 58 | ▶ | my ($self) = @_; | ||||||||||||||||||
|
Subroutine
sse: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||
| 12 | 58 | ▶ | return $self->{_sse} //= do { | ||||||||||||||||||
|
Condition66%2/3
$self->{"_sse"} //= do {
require PAGI::SSE;
"PAGI::SSE"->new($self->{"scope"}, $self->{"receive"}, $self->{"send"})
}
MC/DC0%0/2
$self->{"_sse"} //= do {
require PAGI::SSE;
"PAGI::SSE"->new($self->{"scope"}, $self->{"receive"}, $self->{"send"})
}
$self->{"_sse"}
do {
require PAGI::SSE;
"PAGI::SSE"->new($self->{"scope"}, $self->{"receive"}, $self->{"send"})
}
Truth table66%2/3
A //= B
A= $self->{"_sse"}B= do {
require PAGI::SSE;
"PAGI::SSE"->new($self->{"scope"}, $self->{"receive"}, $self->{"send"})
}
| |||||||||||||||||||||
| 13 | 32 | require PAGI::SSE; | |||||||||||||||||||
| 14 | 32 | PAGI::SSE->new($self->{scope}, $self->{receive}, $self->{send}); | |||||||||||||||||||
| 15 | }; | ||||||||||||||||||||
| 16 | } | ||||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | # ── Connection lifecycle ───────────────────────────────────────────── | ||||||||||||||||||||
| 19 | |||||||||||||||||||||
| 20 | 11 | ▶ | sub start { shift->sse->start(@_) } | ||||||||||||||||||
|
Subroutine
start: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 21 | 3 | ▶ | sub close { shift->sse->close(@_) } | ||||||||||||||||||
|
Subroutine
close: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | # ── Send methods ───────────────────────────────────────────────────── | ||||||||||||||||||||
| 24 | |||||||||||||||||||||
| 25 | 1 | ▶ | sub send { shift->sse->send(@_) } | ||||||||||||||||||
|
Subroutine
send: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 26 | 3 | ▶ | sub send_json { shift->sse->send_json(@_) } | ||||||||||||||||||
|
Subroutine
send_json: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 27 | 1 | ▶ | sub send_event { shift->sse->send_event(@_) } | ||||||||||||||||||
|
Subroutine
send_event: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 28 | 1 | ▶ | sub send_comment { shift->sse->send_comment(@_) } | ||||||||||||||||||
|
Subroutine
send_comment: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | 1 | ▶ | sub try_send { shift->sse->try_send(@_) } | ||||||||||||||||||
|
Subroutine
try_send: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 31 | 1 | ▶ | sub try_send_json { shift->sse->try_send_json(@_) } | ||||||||||||||||||
|
Subroutine
try_send_json: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 32 | 1 | ▶ | sub try_send_comment { shift->sse->try_send_comment(@_) } | ||||||||||||||||||
|
Subroutine
try_send_comment: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 33 | 1 | ▶ | sub try_send_event { shift->sse->try_send_event(@_) } | ||||||||||||||||||
|
Subroutine
try_send_event: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | # ── Iteration helpers ──────────────────────────────────────────────── | ||||||||||||||||||||
| 36 | |||||||||||||||||||||
| 37 | 1 | ▶ | sub each { shift->sse->each(@_) } | ||||||||||||||||||
|
Subroutine
each: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 38 | 0 | ▶ | sub every { shift->sse->every(@_) } | ||||||||||||||||||
|
Subroutine
every: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | # ── State inspection ───────────────────────────────────────────────── | ||||||||||||||||||||
| 41 | |||||||||||||||||||||
| 42 | 2 | ▶ | sub is_started { shift->sse->is_started } | ||||||||||||||||||
|
Subroutine
is_started: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 43 | 3 | ▶ | sub is_closed { shift->sse->is_closed } | ||||||||||||||||||
|
Subroutine
is_closed: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 44 | |||||||||||||||||||||
| 45 | # is_connected overrides the base Context method (which reads pagi.connection, | ||||||||||||||||||||
| 46 | # N/A for sse) to use the SSE wrapper's own state — mirrors Context::WebSocket. | ||||||||||||||||||||
| 47 | 6 | ▶ | sub is_connected { shift->sse->is_connected } | ||||||||||||||||||
|
Subroutine
is_connected: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 48 | |||||||||||||||||||||
| 49 | # ── Protocol metadata ──────────────────────────────────────────────── | ||||||||||||||||||||
| 50 | |||||||||||||||||||||
| 51 | 1 | ▶ | sub last_event_id { shift->sse->last_event_id } | ||||||||||||||||||
|
Subroutine
last_event_id: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 52 | 1 | ▶ | sub http_version { shift->sse->http_version } | ||||||||||||||||||
|
Subroutine
http_version: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 53 | 1 | ▶ | sub keepalive { shift->sse->keepalive(@_) } | ||||||||||||||||||
|
Subroutine
keepalive: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 54 | |||||||||||||||||||||
| 55 | # ── Query parameter accessors ──────────────────────────────────────── | ||||||||||||||||||||
| 56 | # SSE uses query_param (singular) vs WebSocket's query (method name | ||||||||||||||||||||
| 57 | # mirrors what PAGI::SSE exposes). | ||||||||||||||||||||
| 58 | |||||||||||||||||||||
| 59 | 3 | ▶ | sub query_param { shift->sse->query_param(@_) } | ||||||||||||||||||
|
Subroutine
query_param: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 60 | 1 | ▶ | sub query_params { shift->sse->query_params(@_) } | ||||||||||||||||||
|
Subroutine
query_params: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 61 | 1 | ▶ | sub raw_query_param { shift->sse->raw_query_param(@_) } | ||||||||||||||||||
|
Subroutine
raw_query_param: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 62 | 1 | ▶ | sub raw_query_params { shift->sse->raw_query_params(@_) } | ||||||||||||||||||
|
Subroutine
raw_query_params: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 63 | |||||||||||||||||||||
| 64 | # ── Header extras ──────────────────────────────────────────────────── | ||||||||||||||||||||
| 65 | |||||||||||||||||||||
| 66 | 1 | ▶ | sub header_all { shift->sse->header_all(@_) } | ||||||||||||||||||
|
Subroutine
header_all: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 67 | |||||||||||||||||||||
| 68 | 28 | 1; | |||||||||||||||||||
| 69 | |||||||||||||||||||||
| 70 | __END__ | ||||||||||||||||||||