| 1 | package Langertha::Role::Runnable; | ||
| 2 | # ABSTRACT: Common async execution contract for Raider and Raid nodes | ||
| 3 | 7 | our $VERSION = '0.502'; | |
| 4 | 7 | ▶ | use Moose::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | |||
| 7 | 7 | requires 'run_f'; | |
| 8 | |||
| 9 | |||
| 10 | 7 | 1; | |
| 11 | |||
| 12 | __END__ | ||
| 13 | |||
| 14 | =pod | ||
| 15 | |||
| 16 | =encoding UTF-8 | ||
| 17 | |||
| 18 | =head1 NAME | ||
| 19 | |||
| 20 | Langertha::Role::Runnable - Common async execution contract for Raider and Raid nodes | ||
| 21 | |||
| 22 | =head1 VERSION | ||
| 23 | |||
| 24 | version 0.502 | ||
| 25 | |||
| 26 | =head1 SYNOPSIS | ||
| 27 | |||
| 28 | package My::Runnable; | ||
| 29 | use Moose; | ||
| 30 | use Future::AsyncAwait; | ||
| 31 | with 'Langertha::Role::Runnable'; | ||
| 32 | |||
| 33 | async sub run_f { | ||
| 34 | my ( $self, $ctx ) = @_; | ||
| 35 | ... | ||
| 36 | } | ||
| 37 | |||
| 38 | =head1 DESCRIPTION | ||
| 39 | |||
| 40 | Minimal execution contract shared by L<Langertha::Raider> and orchestration | ||
| 41 | nodes under L<Langertha::Raid>. Consumers must implement C<run_f($ctx)>. | ||
| 42 | |||
| 43 | =head2 run_f | ||
| 44 | |||
| 45 | my $result = await $node->run_f($ctx); | ||
| 46 | |||
| 47 | Required method. Executes the runnable node with a context and returns a | ||
| 48 | Future that resolves to a result object. | ||
| 49 | |||
| 50 | =head1 SUPPORT | ||
| 51 | |||
| 52 | =head2 Issues | ||
| 53 | |||
| 54 | Please report bugs and feature requests on GitHub at | ||
| 55 | L<https://github.com/Getty/langertha/issues>. | ||
| 56 | |||
| 57 | =head2 IRC | ||
| 58 | |||
| 59 | Join C<#langertha> on C<irc.perl.org> or message Getty directly. | ||
| 60 | |||
| 61 | =head1 CONTRIBUTING | ||
| 62 | |||
| 63 | Contributions are welcome! Please fork the repository and submit a pull request. | ||
| 64 | |||
| 65 | =head1 AUTHOR | ||
| 66 | |||
| 67 | Torsten Raudssus <getty@cpan.org> | ||
| 68 | |||
| 69 | =head1 COPYRIGHT AND LICENSE | ||
| 70 | |||
| 71 | This software is copyright (c) 2026 by Torsten Raudssus L<https://raudssus.de/>. | ||
| 72 | |||
| 73 | This is free software; you can redistribute it and/or modify it under | ||
| 74 | the same terms as the Perl 5 programming language system itself. | ||
| 75 | |||
| 76 | =cut | ||