RxPerl::Mojo(3pm)

πŸ“¦ version 6.8.2, in alpine 3.24

πŸ’… 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