Dmitry Karasik > Catalyst-Blinker > Catalyst::Blinker

Download:
Catalyst-Blinker-1.0.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 1.0   Source  

NAME ^

Catalyst::Blinker - show a little X11 blinker while Catalyst is reloading

DESCRIPTION ^

I'm developing under Catalyst and am using the Catalyst test server that is running on my local machine and is relaoding every time I'm saving changes to the source tree. This is a cool feature, but I have to wait in front of the browser until the application is loaded full and can answer http requests; if I hit F5 in the browser before it is up and running I get a failure and have to hit it again. I got tired of this and made this little module, that notifies me if it's safe or not to operate the app.

The thing is very primitive. While Catalyst app is loading, it blinks yellow. If it has loaded ok, it shows green light for a couple of seconds and disappears. If there was a failure (syntax failure in my case most of the time), it shows red light which doesn't go away until the problem is fixed.

Wasn't tested on anything other than ubuntu. Most probably wouldn't run on win32 out of box, because the module expects pipes and forks to be working.

SYNOPSIS ^

In your script/myapp.pl, add this, if you want blinker on by default:

    use Catalyst::Blinker;
    Catalyst::Blinker->start;

if you want it off by default, do this instead:

    if ( $ENV{BLINKER} ) {
       require Catalyst::Blinker;
       Catalyst::Blinker->start;
    }

before

    Catalyst::ScriptRunner->run('MyApp', 'Server');

In both cases, the module recognizes $ENV{BLINKER} and parses the passed options (see below), f.ex.

    $ export BLINKER=x=1600,y=-150

API ^

start(@options)

Does the necessary hacks for a fork-based test catalyst server running on a X11 desktop. Dies if there's no X11.

The modules does not do anything unless start() is called. It is safe to use it everywhere.

options

size INT

size of the blinker

x INT

Horizontal position of the blinker. If less than zero, the right desktop border is used.

y INT

Vertical position of the blinker. If less than zero, the bottom desktop border is used.

AUTHOR ^

Dmitry Karasik <dmitry@karasik.eu.org>

LICENSE ^

Copyright (C) 2013, Novozymes.

syntax highlighting: