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