| 1 | 2 | ▶ | use v5.44; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 2 | ▶ | use experimental 'class'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | |||||||||||
| 4 | # Passed to the callback of BoardStreams::Hub->update. The callback changes | ||||||||||
| 5 | # the channel's state through it and queues events; both are committed | ||||||||||
| 6 | # together under one sequence number. | ||||||||||
| 7 | 2 | class BoardStreams::Update { | |||||||||
| 8 | 2 | our $VERSION = "v0.0.60"; | |||||||||
| 9 | |||||||||||
| 10 | 2 | field $state :param; | |||||||||
| 11 | 2 | field @events; | |||||||||
| 12 | |||||||||||
| 13 | # With no argument returns the state (change it in place); | ||||||||||
| 14 | # with an argument replaces it. | ||||||||||
| 15 | 0 | ▶ | method state (@new) { | ||||||||
|
Subroutine
state: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 16 | 0 | ▶ | $state = $new[0] if @new; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | 0 | return $state; | |||||||||
| 18 | 2 | } | |||||||||
| 19 | |||||||||||
| 20 | 0 | ▶ | method emit ($name, $payload = undef) { | ||||||||
|
Subroutine
emit: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 21 | 0 | push @events, { name => $name, payload => $payload }; | |||||||||
| 22 | 0 | return $self; | |||||||||
| 23 | 2 | } | |||||||||
| 24 | |||||||||||
| 25 | 0 | ▶ | method events { @events } | ||||||||
|
Subroutine
events: not called CC=1 SCAR=1.2
Pod
undocumented
| |||||||||||
| 26 | } | ||||||||||
| 27 | |||||||||||
| 28 | 2 | 1; | |||||||||