1Mojo::Server::Morbo::BaUcskeerndC(o3n)tributed Perl DocuMmoejnot:a:tSieornver::Morbo::Backend(3)
2
3
4

NAME

6       Mojo::Server::Morbo::Backend - Morbo backend base class
7

SYNOPSIS

9         package Mojo::Server::Morbo::Backend::Inotify:
10         use Mojo::Base 'Mojo::Server::Morbo::Backend';
11
12         sub modified_files {...}
13

DESCRIPTION

15       Mojo::Server::Morbo::Backend is an abstract base class for Morbo
16       backends, like Mojo::Server::Morbo::Backend::Poll.
17

ATTRIBUTES

19       Mojo::Server::Morbo::Backend implements the following attributes.
20
21   watch
22         my $watch = $backend->watch;
23         $backend  = $backend->watch(['/home/sri/my_app']);
24
25       Files and directories to watch for changes, defaults to the application
26       script as well as the "lib" and "templates" directories in the current
27       working directory.
28
29   watch_timeout
30         my $timeout = $backend->watch_timeout;
31         $backend    = $backend->watch_timeout(10);
32
33       Maximum amount of time in seconds a backend may block when waiting for
34       files to change, defaults to the value of the "MOJO_MORBO_TIMEOUT"
35       environment variable or 1.
36

METHODS

38       Mojo::Server::Morbo::Backend inherits all methods from Mojo::Base and
39       implements the following new ones.
40
41   modified_files
42         my $files = $backend->modified_files;
43
44       Check if files from "watch" have been modified since the last check and
45       return an array reference with the results. Meant to be overloaded in a
46       subclass.
47
48         # All files that have been modified
49         say for @{$backend->modified_files};
50

SEE ALSO

52       Mojolicious, Mojolicious::Guides, <https://mojolicious.org>.
53
54
55
56perl v5.28.0                      2018-05-08   Mojo::Server::Morbo::Backend(3)
Impressum