NAME

ZMQ::Declare::Application - A ZMQ::Declare Application object

SYNOPSIS

use ZMQ::Declare;
# See synopsis for ZMQ::Declare

DESCRIPTION

A ZMQ::Declare::Application object represents any number of 0MQ devices that share the same 0MQ threading context. As such, an application conceptually maps to a single process.

PROPERTIES

These are accessible with normal mutator methods.

name

The name of the application. This is required to be unique in a ZDCF file.

Read-only.

spec

A reference to the underlying ZDCF specification object.

Read-only.

METHODS

new

Constructor taking named arguments (see properties above). Typically, you should obtain your ZMQ::Declare::Application objects by calling application($application_name) on a ZMQ::Declare::ZDCF object instead of using new().

device

Given a device name, creates a ZMQ::Declare::Device object from the information stored in the application and returns that object.

This ZMQ::Declare::Device object is what you can use to actually implement 0MQ devices that are configured through ZDCF. Note that creating a ZMQ::Declare::Device object does not create any 0MQ contexts, sockets, or connections yet, you need to call make_runtime() or run() on the device for that.

As a convenience, the device name defaults to the application name if none is provided. This is to cater to the cases of simple applications that have only one device that needs not have a different name than the application itself.

device_names

Returns a list (not a reference) of device names that are known to the application.

get_context

Creates a ZeroMQ::Context object from the application and returns it. In other words, this creates the actual threading context of 0MQ. Generally, this is called indirectly by using the device method to obtain a ZMQ::Declare::Device object and then calling the run or make_runtime methods on that.

Repeated calls to get_context will return the same threading context object.

SEE ALSO

ZeroMQ

ZMQ::Declare::ZDCF, ZMQ::Declare::Device

AUTHOR

Steffen Mueller <smueller@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2011,2012 by Steffen Mueller

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.1 or, at your option, any later version of Perl 5 you may have available.