WebSocket

NAME

Lumberjack::Application::WebSocket - Lumberjack websocket provider

SYNOPSIS


use Lumberjack;
use Lumberjack::Dispatcher::Supply;
use Lumberjack::Application::WebSocket;

my $s = Lumberjack::Dispatcher::Supply.new;
Lumberjack.dispatchers.append: $s;

my &ws-app = Lumberjack::Application::WebSocket.new(supply => $s.Supply);

# You can of course use it anywhere a P6SGI app can be used:
HTTP::Server::Tiny.new(port => 8898).run(&ws-app);

DESCRIPTION

This class provides a P6SGI application that implements a WebSocket server endpoint that will emit the Lumberjack::Messages that are received on the Supply provided to the constructor.

The messages are emitted as a JSON serialised form and it is the responsibility of the receiving clients to parse and interpret as appropriate. The structure that is used by the Lumberjack::Dispatcher::Proxy and is described (implemented by,) Lumberjack::Message::JSON.

It is the responsibility of the container application to locate the endpoint appropriately, itself it is agnostic to which path it is called at.

METHODS

method new

method new(Supply :$supply!)

The class only has a constructor, with one required parameter supply which must be a Supply which will provide the Lumberjack::Messages that will be sent out by the websocket connect. Typically this will be the Supply of a Lumberjack::Dispatcher::Supply.

Lumberjack::Application v0.0.10

A web facility for the Lumberjack logging framework

Authors

  • Jonathan Stowe

License

Artistic-2.0

Dependencies

Lumberjack:ver<0.1.2+>Lumberjack::Message::JSON:ver<0.0.3+>HTTP::UserAgentHTTP::Server::TinyCrustWebSocketJSON::ClassTemplate6

Test Dependencies

Provides

  • Lumberjack::Application
  • Lumberjack::Application::Index
  • Lumberjack::Application::PSGI
  • Lumberjack::Application::WebSocket
  • Lumberjack::Dispatcher::Proxy
  • Lumberjack::Dispatcher::Supply
  • Lumberjack::Template::Provider

Documentation

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.