NAME
Zing::App - Object Reifier
ABSTRACT
Object Reifier with Dependency Injection
SYNOPSIS
use Zing::App;
my $app = Zing::App->new;
# $app->queue(name => 'tasks')->send({
# job => time,
# ...
# });
DESCRIPTION
This package provides an object which can dynamically load (reify) other Zing objects with dependencies.
LIBRARIES
This package uses type constraints from:
ATTRIBUTES
This package has the following attributes:
env
env(Env)
This attribute is read-only, accepts (Env)
values, and is optional.
host
host(Str)
This attribute is read-only, accepts (Str)
values, and is optional.
name
name(Str)
This attribute is read-only, accepts (Str)
values, and is optional.
pid
pid(Int)
This attribute is read-only, accepts (Int)
values, and is optional.
METHODS
This package implements the following methods:
cartridge
cartridge(Any @args) : Cartridge
The cartridge method returns a new Zing::Cartridge object based on the current env
.
- cartridge example #1
-
# given: synopsis my $cartridge = $app->cartridge( name => 'myapp', ); # Zing::Cartridge->new(...)
cartridge_namespace
cartridge_namespace() : ArrayRef[Str]
The cartridge_namespace method returns a wordlist that represents a cartridge class name.
cartridge_specification
cartridge_specification(Any @args) : Tuple[ArrayRef, ArrayRef]
The cartridge_specification method returns a cartridge specification, class name and args, for the reifier.
- cartridge_specification example #1
-
# given: synopsis $app->cartridge_specification; # [['zing', 'cartridge'], [@args]]
channel
channel(Any @args) : Channel
The channel method returns a new Zing::Channel object based on the currenrt env
.
- channel example #1
-
# given: synopsis my $channel = $app->channel( name => 'messages', ); # Zing::Channel->new(...)
channel_namespace
channel_namespace() : ArrayRef[Str]
The channel_namespace method returns a wordlist that represents a channel class name.
channel_specification
channel_specification(Any @args) : Tuple[ArrayRef, ArrayRef]
The channel_specification method returns a channel specification, class name and args, for the reifier.
- channel_specification example #1
-
# given: synopsis $app->channel_specification; # [['zing', 'channel'], [@args]]
cursor
cursor(Any @args) : Cursor
The cursor method returns a new Zing::Cursor object based on the current env
.
- cursor example #1
-
# given: synopsis my $cursor = $app->cursor( lookup => $app->lookup( name => 'people', ) ); # Zing::Cursor->new(...)
cursor_namespace
cursor_namespace() : ArrayRef[Str]
The cursor_namespace method returns a wordlist that represents a cursor class name.
cursor_specification
cursor_specification(Any @args) : Tuple[ArrayRef, ArrayRef]
The cursor_specification method returns a cursor specification, class name and args, for the reifier.
- cursor_specification example #1
-
# given: synopsis $app->cursor_specification; # [['zing', 'cursor'], [@args]]
daemon
daemon(Any @args) : Daemon
The daemon method returns a new Zing::Daemon object based on the currenrt env
.
- daemon example #1
-
# given: synopsis my $daemon = $app->daemon( cartridge => $app->cartridge( name => 'myapp', ) ); # Zing::Daemon->new(...)
daemon_namespace
daemon_namespace() : ArrayRef[Str]
The daemon_namespace method returns a wordlist that represents a daemon class name.
daemon_specification
daemon_specification(Any @args) : Tuple[ArrayRef, ArrayRef]
The daemon_specification method returns a daemon specification, class name and args, for the reifier.
- daemon_specification example #1
-
# given: synopsis $app->daemon_specification; # [['zing', 'daemon'], [@args]]
data
data(Any @args) : Data
The data method returns a new Zing::Data object based on the current env
.
- data example #1
-
# given: synopsis my $data = $app->data( name => 'random', ); # Zing::Data->new(...)
data_namespace
data_namespace() : ArrayRef[Str]
The data_namespace method returns a wordlist that represents a data class name.
data_specification
data_specification(Any @args) : Tuple[ArrayRef, ArrayRef]
The data_specification method returns a data specification, class name and args, for the reifier.
- data_specification example #1
-
# given: synopsis $app->data_specification; # [['zing', 'data'], [@args]]
domain
domain(Any @args) : Domain
The domain method returns a new Zing::Domain object based on the currenrt env
.
- domain example #1
-
# given: synopsis my $domain = $app->domain( name => 'person', ); # Zing::Domain->new(...)
domain_namespace
domain_namespace() : ArrayRef[Str]
The domain_namespace method returns a wordlist that represents a domain class name.
domain_specification
domain_specification(Any @args) : Tuple[ArrayRef, ArrayRef]
The domain_specification method returns a domain specification, class name and args, for the reifier.
- domain_specification example #1
-
# given: synopsis $app->domain_specification; # [['zing', 'domain'], [@args]]
encoder
encoder(Any @args) : Encoder
The encoder method returns a new Zing::Encoder object based on the current env
.
encoder_namespace
encoder_namespace() : ArrayRef[Str]
The encoder_namespace method returns a wordlist that represents a encoder class name.
encoder_specification
encoder_specification(Any @args) : Tuple[ArrayRef, ArrayRef]
The encoder_specification method returns a encoder specification, class name and args, for the reifier.
- encoder_specification example #1
-
# given: synopsis $app->encoder_specification; # [['zing', 'encoder'], [@args]]
for
for(Any %args) : App
The for method changes the env
and returns a new app
object.
fork
fork(Any @args) : Fork
The fork method returns a new Zing::Fork object based on the currenrt env
.
- fork example #1
-
# given: synopsis my $fork = $app->fork( parent => $app->process, scheme => ['MyApp', [], 1], ); # Zing::Fork->new(...)
fork_namespace
fork_namespace() : ArrayRef[Str]
The fork_namespace method returns a wordlist that represents a fork class name.
fork_specification
fork_specification(Any @args) : Tuple[ArrayRef, ArrayRef]
The fork_specification method returns a fork specification, class name and args, for the reifier.
- fork_specification example #1
-
# given: synopsis $app->fork_specification; # [['zing', 'fork'], [@args]]
id
id(Any @args) : ID
The id method returns a new Zing::ID object based on the current env
.
id_namespace
id_namespace() : ArrayRef[Str]
The id_namespace method returns a wordlist that represents a id class name.
id_specification
id_specification(Any @args) : Tuple[ArrayRef, ArrayRef]
The id_specification method returns a id specification, class name and args, for the reifier.
journal
journal(Any @args) : Journal
The journal method returns a new Zing::Journal object based on the currenrt env
.
journal_namespace
journal_namespace() : ArrayRef[Str]
The journal_namespace method returns a wordlist that represents a journal class name.
journal_specification
journal_specification(Any @args) : Tuple[ArrayRef, ArrayRef]
The journal_specification method returns a journal specification, class name and args, for the reifier.
- journal_specification example #1
-
# given: synopsis $app->journal_specification; # [['zing', 'journal'], [@args]]
kernel
kernel(Any @args) : Kernel
The kernel method returns a new Zing::Kernel object based on the current env
.
- kernel example #1
-
# given: synopsis my $kernel = $app->kernel( scheme => ['MyApp', [], 1], ); # Zing::Kernel->new(...)
kernel_namespace
kernel_namespace() : ArrayRef[Str]
The kernel_namespace method returns a wordlist that represents a kernel class name.
kernel_specification
kernel_specification(Any @args) : Tuple[ArrayRef, ArrayRef]
The kernel_specification method returns a kernel specification, class name and args, for the reifier.
- kernel_specification example #1
-
# given: synopsis $app->kernel_specification; # [['zing', 'kernel'], [@args]]
keyval
keyval(Any @args) : KeyVal
The keyval method returns a new Zing::KeyVal object based on the currenrt env
.
- keyval example #1
-
# given: synopsis my $keyval = $app->keyval( name => 'backup', ); # Zing::KeyVal->new(...)
keyval_namespace
keyval_namespace() : ArrayRef[Str]
The keyval_namespace method returns a wordlist that represents a keyval class name.
keyval_specification
keyval_specification(Any @args) : Tuple[ArrayRef, ArrayRef]
The keyval_specification method returns a keyval specification, class name and args, for the reifier.
- keyval_specification example #1
-
# given: synopsis $app->keyval_specification; # [['zing', 'key-val'], [@args]]
launcher
launcher(Any @args) : Launcher
The launcher method returns a new Zing::Launcher object based on the currenrt env
.
launcher_namespace
launcher_namespace() : ArrayRef[Str]
The launcher_namespace method returns a wordlist that represents a launcher class name.
launcher_specification
launcher_specification(Any @args) : Tuple[ArrayRef, ArrayRef]
The launcher_specification method returns a launcher specification, class name and args, for the reifier.
- launcher_specification example #1
-
# given: synopsis $app->launcher_specification; # [['zing', 'launcher'], [@args]]
logger
logger(Any @args) : Logger
The logger method returns a new FlightRecorder object based on the currenrt env
.
lookup
lookup(Any @args) : Lookup
The lookup method returns a new Zing::Lookup object based on the currenrt env
.
- lookup example #1
-
# given: synopsis my $lookup = $app->lookup( name => 'people', ); # Zing::Lookup->new(...)
lookup_namespace
lookup_namespace() : ArrayRef[Str]
The lookup_namespace method returns a wordlist that represents a lookup class name.
lookup_specification
lookup_specification(Any @args) : Tuple[ArrayRef, ArrayRef]
The lookup_specification method returns a lookup specification, class name and args, for the reifier.
- lookup_specification example #1
-
# given: synopsis $app->lookup_specification; # [['zing', 'lookup'], [@args]]
mailbox
mailbox(Any @args) : Mailbox
The mailbox method returns a new Zing::Mailbox object based on the currenrt env
.
- mailbox example #1
-
# given: synopsis my $mailbox = $app->mailbox( name => 'shared', ); # Zing::Mailbox->new(...)
mailbox_namespace
mailbox_namespace() : ArrayRef[Str]
The mailbox_namespace method returns a wordlist that represents a mailbox class name.
mailbox_specification
mailbox_specification(Any @args) : Tuple[ArrayRef, ArrayRef]
The mailbox_specification method returns a mailbox specification, class name and args, for the reifier.
- mailbox_specification example #1
-
# given: synopsis $app->mailbox_specification; # [['zing', 'mailbox'], [@args]]
meta
meta(Any @args) : Meta
The meta method returns a new Zing::Meta object based on the currenrt env
.
meta_namespace
meta_namespace() : ArrayRef[Str]
The meta_namespace method returns a wordlist that represents a meta class name.
meta_specification
meta_specification(Any @args) : Tuple[ArrayRef, ArrayRef]
The meta_specification method returns a meta specification, class name and args, for the reifier.
- meta_specification example #1
-
# given: synopsis $app->meta_specification; # [['zing', 'meta'], [@args]]
process
process(Any @args) : Process
The process method returns a new Zing::Process object based on the currenrt env
.
process_namespace
process_namespace() : ArrayRef[Str]
The process_namespace method returns a wordlist that represents a process class name.
process_specification
process_specification(Any @args) : Tuple[ArrayRef, ArrayRef]
The process_specification method returns a process specification, class name and args, for the reifier.
- process_specification example #1
-
# given: synopsis $app->process_specification; # [['zing', 'process'], [@args]]
pubsub
pubsub(Any @args) : PubSub
The pubsub method returns a new Zing::PubSub object based on the currenrt env
.
- pubsub example #1
-
# given: synopsis my $pubsub = $app->pubsub( name => 'commands', ); # Zing::PubSub->new(...)
pubsub_namespace
pubsub_namespace() : ArrayRef[Str]
The pubsub_namespace method returns a wordlist that represents a pubsub class name.
pubsub_specification
pubsub_specification(Any @args) : Tuple[ArrayRef, ArrayRef]
the pubsub_specification method returns a i<pubsub> specification, class name and args, for the reifier.
- pubsub_specification example #1
-
# given: synopsis $app->pubsub_specification; # [['zing', 'pub-sub'], [@args]]
queue
queue(Any @args) : Queue
The queue method returns a new Zing::Queue object based on the currenrt env
.
- queue example #1
-
# given: synopsis my $queue = $app->queue( name => 'tasks', ); # Zing::Queue->new(...)
queue_namespace
queue_namespace() : ArrayRef[Str]
The queue_namespace method returns a wordlist that represents a queue class name.
queue_specification
queue_specification(Any @args) : Tuple[ArrayRef, ArrayRef]
The queue_specification method returns a queue specification, class name and args, for the reifier.
- queue_specification example #1
-
# given: synopsis $app->queue_specification; # [['zing', 'queue'], [@args]]
reify
reify(Tuple[ArrayRef, ArrayRef] $spec) : Object
The reify method executes a specification, reifies and returns an object.
- reify example #1
-
# given: synopsis my $queue = $app->reify( [['zing', 'queue'], ['name', 'tasks']], ); # Zing::Queue->new( # name => 'tasks' # )
repo
repo(Any @args) : Repo
The repo method returns a new Zing::Repo object based on the currenrt env
.
- repo example #1
-
# given: synopsis my $repo = $app->repo( name => '$registry', ); # Zing::Repo->new(...)
repo_namespace
repo_namespace() : ArrayRef[Str]
The repo_namespace method returns a wordlist that represents a repo class name.
repo_specification
repo_specification(Any @args) : Tuple[ArrayRef, ArrayRef]
The repo_specification method returns a repo specification, class name and args, for the reifier.
- repo_specification example #1
-
# given: synopsis $app->repo_specification; # [['zing', 'repo'], [@args]]
ring
ring(Any @args) : Ring
The ring method returns a new Zing::Ring object based on the currenrt env
.
- ring example #1
-
# given: synopsis my $ring = $app->ring( processes => [ $app->process, $app->process, ], ); # Zing::Ring->new(...)
ring_namespace
ring_namespace() : ArrayRef[Str]
The ring_namespace method returns a wordlist that represents a ring class name.
ring_specification
ring_specification(Any @args) : Tuple[ArrayRef, ArrayRef]
The ring_specification method returns a ring specification, class name and args, for the reifier.
- ring_specification example #1
-
# given: synopsis $app->ring_specification; # [['zing', 'ring'], [@args]]
ringer
ringer(Any @args) : Ring
The ringer method returns a new Zing::Ringer object based on the currenrt env
.
- ringer example #1
-
# given: synopsis my $ringer = $app->ringer( schemes => [ ['MyApp1', [], 1], ['MyApp2', [], 1], ], ); # Zing::Ringer->new(...)
ringer_namespace
ringer_namespace() : ArrayRef[Str]
The ringer_namespace method returns a wordlist that represents a ringer class name.
ringer_specification
ringer_specification(Any @args) : Tuple[ArrayRef, ArrayRef]
The ringer_specification method returns a ringer specification, class name and args, for the reifier.
- ringer_specification example #1
-
# given: synopsis $app->ringer_specification; # [['zing', 'ringer'], [@args]]
savepoint
savepoint(Any @args) : Savepoint
The savepoint method returns a new Zing::Savepoint object based on the currenrt env
.
- savepoint example #1
-
# given: synopsis my $savepoint = $app->savepoint( lookup => $app->lookup( name => 'people', ) ); # Zing::Savepoint->new(...)
savepoint_namespace
savepoint_namespace() : ArrayRef[Str]
The savepoint_namespace method returns a wordlist that represents a savepoint class name.
savepoint_specification
savepoint_specification(Any @args) : Tuple[ArrayRef, ArrayRef]
The savepoint_specification method returns a savepoint specification, class name and args, for the reifier.
- savepoint_specification example #1
-
# given: synopsis $app->savepoint_specification; # [['zing', 'savepoint'], [@args]]
scheduler
scheduler(Any @args) : Scheduler
The scheduler method returns a new Zing::Scheduler object based on the currenrt env
.
scheduler_namespace
scheduler_namespace() : ArrayRef[Str]
The scheduler_namespace method returns a wordlist that represents a scheduler class name.
scheduler_specification
scheduler_specification(Any @args) : Tuple[ArrayRef, ArrayRef]
The scheduler_specification method returns a scheduler specification, class name and args, for the reifier.
- scheduler_specification example #1
-
# given: synopsis $app->scheduler_specification; # [['zing', 'scheduler'], [@args]]
search
search(Any @args) : Search
The search method returns a new Zing::Search object based on the currenrt env
.
search_namespace
search_namespace() : ArrayRef[Str]
The search_namespace method returns a wordlist that represents a search class name.
search_specification
search_specification(Any @args) : Tuple[ArrayRef, ArrayRef]
The search_specification method returns a search specification, class name and args, for the reifier.
- search_specification example #1
-
# given: synopsis $app->search_specification; # [['zing', 'search'], [@args]]
simple
simple(Any @args) : Simple
The simple method returns a new Zing::Simple object based on the currenrt env
.
simple_namespace
simple_namespace() : ArrayRef[Str]
The simple_namespace method returns a wordlist that represents a simple class name.
simple_specification
simple_specification(Any @args) : Tuple[ArrayRef, ArrayRef]
The simple_specification method returns a simple specification, class name and args, for the reifier.
- simple_specification example #1
-
# given: synopsis $app->simple_specification; # [['zing', 'simple'], [@args]]
single
single(Any @args) : Single
The single method returns a new Zing::Single object based on the currenrt env
.
single_namespace
single_namespace() : ArrayRef[Str]
The single_namespace method returns a wordlist that represents a single class name.
single_specification
single_specification(Any @args) : Tuple[ArrayRef, ArrayRef]
The single_specification method returns a single specification, class name and args, for the reifier.
- single_specification example #1
-
# given: synopsis $app->single_specification; # [['zing', 'single'], [@args]]
space
space(Str @args) : Space
The space method returns a new Data::Object::Space object.
- space example #1
-
# given: synopsis my $space = $app->space( 'zing', ); # Data::Object::Space->new(...)
spawner
spawner(Any @args) : Spawner
The spawner method returns a new Zing::Spawner object based on the currenrt env
.
spawner_namespace
spawner_namespace() : ArrayRef[Str]
The spawner_namespace method returns a wordlist that represents a spawner class name.
spawner_specification
spawner_specification(Any @args) : Tuple[ArrayRef, ArrayRef]
The spawner_specification method returns a spawner specification, class name and args, for the reifier.
- spawner_specification example #1
-
# given: synopsis $app->spawner_specification; # [['zing', 'spawner'], [@args]]
store
store(Any @args) : Store
The store method returns a new Zing::Store object based on the currenrt env
.
- store example #1
-
# given: synopsis my $store = $app->store; # Zing::Store::Hash->new(...) # e.g. # $app->env->store # Zing::Store::Hash # e.g. # $ENV{ZING_STORE} # Zing::Store::Hash
store_namespace
store_namespace() : ArrayRef[Str]
The store_namespace method returns a wordlist that represents a store class name.
store_specification
store_specification(Any @args) : Tuple[ArrayRef, ArrayRef]
The store_specification method returns a store specification, class name and args, for the reifier.
- store_specification example #1
-
# given: synopsis $app->store_specification; # [['zing', 'store'], [@args]]
term
term(Any @args) : Term
The term method returns a new Zing::Term object based on the currenrt env
.
timer
timer(Any @args) : Timer
The timer method returns a new Zing::Timer object based on the currenrt env
.
timer_namespace
timer_namespace() : ArrayRef[Str]
The timer_namespace method returns a wordlist that represents a timer class name.
timer_specification
timer_specification(Any @args) : Tuple[ArrayRef, ArrayRef]
The timer_specification method returns a timer specification, class name and args, for the reifier.
- timer_specification example #1
-
# given: synopsis $app->timer_specification; # [['zing', 'timer'], [@args]]
watcher
watcher(Any @args) : Watcher
The watcher method returns a new Zing::Watcher object based on the currenrt env
.
watcher_namespace
watcher_namespace() : ArrayRef[Str]
The watcher_namespace method returns a wordlist that represents a watcher class name.
watcher_specification
watcher_specification(Any @args) : Tuple[ArrayRef, ArrayRef]
The watcher_specification method returns a watcher specification, class name and args, for the reifier.
- watcher_specification example #1
-
# given: synopsis $app->watcher_specification; # [['zing', 'watcher'], [@args]]
worker
worker(Any @args) : Worker
The worker method returns a new Zing::Worker object based on the currenrt env
.
worker_namespace
worker_namespace() : ArrayRef[Str]
The worker_namespace method returns a wordlist that represents a worker class name.
worker_specification
worker_specification(Any @args) : Tuple[ArrayRef, ArrayRef]
The worker_specification method returns a worker specification, class name and args, for the reifier.
- worker_specification example #1
-
# given: synopsis $app->worker_specification; # [['zing', 'worker'], [@args]]
zang
zang() : App
The zang method returns a new Zing::Zang object.
zing
zing(Any @args) : Zing
The zing method returns a new Zing object.
- zing example #1
-
# given: synopsis my $zing = $app->zing( scheme => ['MyApp', [], 1], ); # Zing->new(...)
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".