The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Zing::Watcher - Watcher Process

ABSTRACT

Watcher Process

SYNOPSIS

  package MyApp;

  use parent 'Zing::Watcher';

  sub perform {
    time;
  }

  sub receive {
    my ($self, $from, $data) = @_;

    [$from, $data];
  }

  sub scheme {
    ['MyApp::Handler', [], 1];
  }

  package main;

  my $myapp = MyApp->new;

  # $myapp->execute;

DESCRIPTION

This package provides a Zing::Process which forks a scheme using Zong::Fork and maintains the desired active processes. The standard process perform and receive methods operate as expected.

INHERITS

This package inherits behaviors from:

Zing::Process

LIBRARIES

This package uses type constraints from:

Zing::Types

SCENARIOS

This package supports the following scenarios:

perform

  # given: synopsis

  $myapp->perform;

The perform method is meant to be implemented by a subclass and is automatically invoked iteratively by the event-loop.

receive

  # given: synopsis

  $myapp->receive($myapp->name, { status => 'ok' });

The receive method is meant to be implemented by a subclass and is automatically invoked iteratively by the event-loop.

scheme

  # given: synopsis

  $myapp->scheme;

The scheme method is meant to be implemented by a subclass and is automatically invoked when the process is executed.

AUTHOR

Al Newkirk, awncorp@cpan.org

LICENSE

Copyright (C) 2011-2019, Al Newkirk, et al.

This is free software; you can redistribute it and/or modify it under the terms of the The Apache License, Version 2.0, as elucidated in the "license file".

PROJECT

Wiki

Project

Initiatives

Milestones

Contributing

Issues