RxPerl::Mojo(3pm)
π
RxPerl::Mojo β the RxPerl::Mojo(3pm) page, but make it make sense
okay so bestie, this is the manual page for RxPerl::Mojo, straight out of the User Contributed Perl Documentation section. it's a whole vibe and honestly kind of iconic, so let's get into it π«Ά
β¨ NAME β¨
RxPerl::Mojo β it's the Mojo::IOLoop adapter for RxPerl. that's the whole name, no cap. it's giving "glue module that makes two beautiful things work together" π
πΈ SYNOPSIS πΈ
here's the little demo they give you β copy it exactly, don't @ me:
use RxPerl::Mojo ':all';
use Mojo::IOLoop;
sub make_observer ($i) {
return {
next => sub {say "next #$i: ", $_[0]},
error => sub {say "error #$i: ", $_[0]},
complete => sub {say "complete #$i"},
};
}
my $o = rx_interval(0.7)->pipe(
op_map(sub {$_[0] * 2}),
op_take_until( rx_timer(5) ),
);
$o->subscribe(make_observer(1));
Mojo::IOLoop->start;
so basically: you use RxPerl::Mojo ':all'; (note the :all import tag, she's important β¨), you pull in Mojo::IOLoop, you build a lil observer factory make_observer that hands back a hashref with next, error and complete callbacks, then you make an observable with rx_interval(0.7), pipe it through op_map (which doubles every value, $_[0] * 2, slay) and op_take_until( rx_timer(5) ), subscribe your observer, and hit Mojo::IOLoop->start; to actually get the loop going. the whole thing is literally a tiny timer demo and it ate π₯
π¦ DESCRIPTION π¦
so what is this module even doing? RxPerl::Mojo is the module that lets you use the RxPerl Reactive Extensions in your Mojolicious app, or in any app that uses Mojo::IOLoop. that's it, that's the whole pitch β reactive stream energy, but in your Mojo world π
π DOCUMENTATION π
the docs over at RxPerl apply to this module too. like, all of them. same facts, just with a Mojo-shaped hat on π
β NOTE β
listen up, this one matters π β because of a bug in Mojo::Promise which was fixed in Mojolicious 8.15, RxPerl's two promise functions, first_value_from and last_value_from, require Mojolicious 8.15 or above. no skirting around it, no legacy Mojolicious for you, ngl.
basically: if you're on anything older than 8.15, those two functions are gonna have a bad time π
π NOTIFICATIONS FOR NEW RELEASES π
you can start receiving emails for new releases of this module, or other modules, over at https://perlmodules.net. yes bestie, you can be first in line for the drop, it's giving newsletter main character energy π¬
π COMMUNITY CODE OF CONDUCT π
the Community Code of Conduct can be found here. be nice, be kind, keep the vibes immaculate β¨ (it's the standard CoC situation, iykyk)
π LICENSE π
Copyright (C) 2020 Karelcom OΓ.
this library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. so go off, remix it, ship it, just keep those terms π«Ά
π AUTHOR π
Alexander Karelas β karjala@cpan.org π
and that's the page!! π§
cute lil sign-off for you: this whole thing is from perl v5.42.2, dated 2026-02-15, and it's the RxPerl::Mojo(3pm) page β so go forth, write reactive Mojo code, and remember to Mojo::IOLoop->start or literally nothing happens ππ
π¦ where this page comes from
- alpine 3.24: perl-rxperl-mojo-doc 6.8.2-r1 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms