Net::WAMP::Role::Dealer - Dealer role for Net::WAMP
package MyRouter; use parent qw( Net::WAMP::Role::Dealer ); #For security, this defaults to rejecting everything! sub deny_CALL { my ($self, $CALL_msg) = @_; my $session_obj = $self->get_session(); #success return; #fail, generic (Error = wamp.error.not_authorized) return 1; #fail, custom Auxiliary (Error = wamp.error.not_authorized) return { foo => 1 }; #fail, generic Auxiliary, custom Error return 1, 'myapp.error.go_away'; #fail, custom Auxiliary and Error return { foo => 1 }, 'myapp.error.go_away'; } #This follows the same pattern as deny_CALL(). #It also defaults to rejecting everything. sub deny_REGISTER { ... }
This is an EXPERIMENTAL WAMP Dealer implementation. If you use it, please send feedback!
To have a useful Dealer you’ll need to create a deny_CALL method, since the default is to deny all CALL requests. If that Broker is to allow REGISTER requests, you’ll also need a deny_REGISTER() method. The format of these is described above.
deny_CALL
deny_REGISTER()
Dealer only exposes a few public methods:
This function registers a session to supply the given procedure, independently of actual WAMP messaging. This is useful, e.g., if you want to “auto-register” a procedure to a given session.
The return is the same number that is sent in a REGISTERED message’s Registration. No REGISTERED message is sent, however.
Registration
Undoes a registration, without sending an UNREGISTERED message.
To install Net::WAMP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::WAMP
CPAN shell
perl -MCPAN -e shell install Net::WAMP
For more information on module installation, please visit the detailed CPAN module installation guide.