| 1 | package Langertha::Raider::Hall::ACP::SubStream; | ||
| 2 | 73 | our $VERSION = '0.503'; | |
| 3 | # ABSTRACT: Internal stream shim feeding hall output into an ACP callback | ||
| 4 | |||
| 5 | |||
| 6 | 73 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 73 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 22 | ▶ | sub new { |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 10 | 22 | my ($class, %args) = @_; | |
| 11 | 22 | bless { cb => $args{cb}, opened => 1 }, $class; | |
| 12 | } | ||
| 13 | 33 | ▶ | sub write { |
|
Subroutine
write: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 14 | 33 | my ($self, $line) = @_; | |
| 15 | 33 | chomp(my $l = $line); | |
| 16 | 33 | $self->{cb}->($l); | |
| 17 | 33 | return 1; | |
| 18 | } | ||
| 19 | 78 | ▶ | sub handle { $_[0] } |
|
Subroutine
handle: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 20 | 39 | ▶ | sub opened { $_[0]->{opened} } |
|
Subroutine
opened: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 21 | |||
| 22 | # The hall drops a subscriber whose stream is no longer opened. | ||
| 23 | 17 | ▶ | sub close { $_[0]->{opened} = 0 } |
|
Subroutine
close: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 24 | |||
| 25 | 73 | 1; | |
| 26 | |||
| 27 | __END__ | ||
| 28 | |||
| 29 | =pod | ||
| 30 | |||
| 31 | =encoding UTF-8 | ||
| 32 | |||
| 33 | =head1 NAME | ||
| 34 | |||
| 35 | Langertha::Raider::Hall::ACP::SubStream - Internal stream shim feeding hall output into an ACP callback | ||
| 36 | |||
| 37 | =head1 VERSION | ||
| 38 | |||
| 39 | version 0.503 | ||
| 40 | |||
| 41 | =head1 DESCRIPTION | ||
| 42 | |||
| 43 | B<Internal module.> Its interface may change without notice. | ||
| 44 | |||
| 45 | Minimal stand-in for an L<IO::Async::Stream> used by | ||
| 46 | L<Langertha::Raider::Hall::ACP>: each written JSON line is passed to a | ||
| 47 | callback. | ||
| 48 | |||
| 49 | =head1 SUPPORT | ||
| 50 | |||
| 51 | =head2 Issues | ||
| 52 | |||
| 53 | Please report bugs and feature requests on GitHub at | ||
| 54 | L<https://github.com/Getty/langertha-raider/issues>. | ||
| 55 | |||
| 56 | =head2 IRC | ||
| 57 | |||
| 58 | Join C<#langertha> on C<irc.perl.org> or message Getty directly. | ||
| 59 | |||
| 60 | =head1 CONTRIBUTING | ||
| 61 | |||
| 62 | Contributions are welcome! Please fork the repository and submit a pull request. | ||
| 63 | |||
| 64 | =head1 AUTHOR | ||
| 65 | |||
| 66 | Torsten Raudssus <torsten@raudssus.de> L<https://raudssus.de/> | ||
| 67 | |||
| 68 | =head1 COPYRIGHT AND LICENSE | ||
| 69 | |||
| 70 | This software is copyright (c) 2026 by Torsten Raudssus. | ||
| 71 | |||
| 72 | This is free software; you can redistribute it and/or modify it under | ||
| 73 | the same terms as the Perl 5 programming language system itself. | ||
| 74 | |||
| 75 | =cut | ||