NAME

Yancy::Backend::Role::Sync - A role to give a synchronous backend useful Promises methods

VERSION

version 1.088

SYNOPSIS

package Yancy::Backend::SyncOnly;
with 'Yancy::Backend::Role::Sync';

package main;
my $be = Yancy::Backend::SyncOnly->new;
my $promise = $be->create_p( \%item );

DESCRIPTION

This role implements list_p, get_p, set_p, delete_p, and create_p methods that return Mojo::Promise objects for synchronous backends. This does not make the backend asynchronous: The original, synchronous method is called and a promise object created from the result. The promise is then returned already fulfilled.

SEE ALSO

Yancy::Backend

AUTHOR

Doug Bell <preaction@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2021 by Doug Bell.

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