| 1 | package Langertha::Role::Runnable; | ||
| 2 | # ABSTRACT: Common async execution contract (run_f) for runnable nodes | ||
| 3 | 2 | our $VERSION = '0.503'; | |
| 4 | 2 | ▶ | use Moose::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | |||
| 7 | 2 | requires 'run_f'; | |
| 8 | |||
| 9 | |||
| 10 | 2 | 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 (run_f) for runnable nodes | ||
| 21 | |||
| 22 | =head1 VERSION | ||
| 23 | |||
| 24 | version 0.503 | ||
| 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, dependency-free execution contract: consumers implement C<run_f($ctx)> | ||
| 41 | and return a Future. A generic core primitive with no coupling to any particular | ||
| 42 | runner — the Raider agent and the Raid orchestration nodes in the langertha-raider | ||
| 43 | distribution are consumers, but nothing here depends on them. | ||
| 44 | |||
| 45 | =head2 run_f | ||
| 46 | |||
| 47 | my $result = await $node->run_f($ctx); | ||
| 48 | |||
| 49 | Required method. Executes the runnable node with a context and returns a | ||
| 50 | Future that resolves to a result object. | ||
| 51 | |||
| 52 | =head1 SUPPORT | ||
| 53 | |||
| 54 | =head2 Issues | ||
| 55 | |||
| 56 | Please report bugs and feature requests on GitHub at | ||
| 57 | L<https://github.com/Getty/langertha/issues>. | ||
| 58 | |||
| 59 | =head2 IRC | ||
| 60 | |||
| 61 | Join C<#langertha> on C<irc.perl.org> or message Getty directly. | ||
| 62 | |||
| 63 | =head1 CONTRIBUTING | ||
| 64 | |||
| 65 | Contributions are welcome! Please fork the repository and submit a pull request. | ||
| 66 | |||
| 67 | =head1 AUTHOR | ||
| 68 | |||
| 69 | Torsten Raudssus <getty@cpan.org> | ||
| 70 | |||
| 71 | =head1 COPYRIGHT AND LICENSE | ||
| 72 | |||
| 73 | This software is copyright (c) 2026 by Torsten Raudssus L<https://raudssus.de/>. | ||
| 74 | |||
| 75 | This is free software; you can redistribute it and/or modify it under | ||
| 76 | the same terms as the Perl 5 programming language system itself. | ||
| 77 | |||
| 78 | =cut | ||