The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

OpenFrame::Slot::Dispatch - Dispatch applications

SYNOPSIS

  my $config = OpenFrame::Config->new();
  $config->setKey(
     'SLOTS', [ {
       dispatch => 'Local',
       name     => 'OpenFrame::Slot::Dispatch',
       config   => {
         installed_applications => [
           {
             name      => 'hangman',
             uri       => '/hangman/',
             dispatch  => 'Local',
             namespace => 'Hangman::Application',
             config   => { words => "../hangman/words.txt" },
           },
           {
             name      => 'eliza',
             uri       => '/eliza/',
             dispatch  => 'Local',
             namespace => 'Eliza::Application',
           },
         ],
       },
     },
   ],
  );

DESCRIPTION

This module is a special OpenFrame slot that allows dispatching of applications depending on the URI. It is useful for as functionality is often distributed via different URIs.

It is important to remember that OpenFrame::Slot::Dispatch requires a session to work, so you must have included an OpenFrame::Slot::Session previously in the slot pipeline before this is run.

Each application is tested in turn with the current OpenFrame::AbstractRequest, and if the request URI matches the application URI the application is dispatched.

Each application has its own name, determined via the "name" option. This allows each application to save data inside the session.

The Perl module to be loaded and run when the application is dispatched is set via the "namespace" option. See OpenFrame::Application for what this module should contain.

Each application can also optionally have a "config" option, which is passed to the application when it is dispatched.

Applications can either be local ("dispatch" => "Local") or remote via SOAP ("dispatch" => "SOAP").

SEE ALSO

OpenFrame::Application, OpenFrame::Slot::Dispatch::Local, OpenFrame::Slot::Dispatch::SOAP

AUTHOR

James A. Duncan <jduncan@fotango.com>

COPYRIGHT

Copyright (C) 2001, Fotango Ltd.

This module is free software; you can redistribute it or modify it under the same terms as Perl itself.