Jan Henning Thorsen > Toadfarm > Ubic::Service::Toadfarm

Download:
Toadfarm-0.45.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Source  

NAME ^

Ubic::Service::Toadfarm - Ubic Toadfarm service class

DESCRIPTION ^

This class require Ubic which is not automatically installed by Toadfarm.

SYNOPSIS ^

Put the code below in a ubic service file:

  use Ubic::Service::Toadfarm;
  Ubic::Service::Toadfarm->new(
    log => {
      file => '/path/to/log/file', # required
      combined => 1,
    },

    # toadfarm config args
    secret => 'super secret',
    apps => [...],
    plugins => [...],
  );

Details

Hypnotoad starter

It is possible to use this module as a generic hypnotoad starter, instead of Ubic::Service::Hypnotoad, by setting the "HYPNOTOAD_APP" environment variable:

  use Ubic::Service::Toadfarm;
  Ubic::Service::Toadfarm->new(
    env => {
      HYPNOTOAD_APP => '/path/to/my-mojo-app',
    },
  );

METHODS ^

new

See "SYNOPSIS".

start_impl

This is called when you run ubic start. It will start toadfarm using hypnotoad after writing the toadfarm config and settings MOJO_CONFIG.

The config will be written to the "tmp" directory in ubic's data directory.

status_impl

This method will issue a HTTP "HEAD /ubic-status" request to the server. The response is not important, the important thing is that the server responds.

stop_impl

This method will kill the server pid found in "pid_file" with "TERM".

reload

This method will reload the server pid found in "pid_file" with "USR2".

AUTHOR ^

Jan Henning Thorsen - jhthorsen@cpan.org

syntax highlighting: