NAME

WWW::MailboxOrg::Role::IO - Interface role for pluggable JSON-RPC backends

VERSION

version 0.001

SYNOPSIS

package My::AsyncIO;
use Moo;
with 'WWW::MailboxOrg::Role::IO';

sub call {
    my ($self, $req) = @_;
    my $result = $self->_do_rpc($req);
    return WWW::MailboxOrg::JSONRPCResponse->new(%$result);
}

DESCRIPTION

This role defines the interface that JSON-RPC backends must implement. WWW::MailboxOrg::Role::HTTP delegates all RPC communication through this interface, making it possible to swap out the transport layer.

The default backend is WWW::MailboxOrg::LWPIO (synchronous, using Mojo::UserAgent). To use an async event loop, implement this role.

REQUIRED METHODS

call($req)

Execute a WWW::MailboxOrg::JSONRPCRequest. Receives the request object with method, params, and id already set.

Must return a WWW::MailboxOrg::JSONRPCResponse.

SUPPORT

Issues

Please report bugs and feature requests on GitHub at https://github.com/getty/p5-www-mailboxorg/issues.

IRC

Join #perl-help on irc.perl.org or message Getty directly.

CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

AUTHOR

Torsten Raudssus <getty@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.