| 1 | package Beekeeper::Worker::Extension::RemoteSession; | ||
| 2 | |||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 1 | our $VERSION = '0.10'; | |
| 7 | |||
| 8 | 1 | ▶ | use Exporter 'import'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 1 | our @EXPORT = qw( | |
| 11 | bind_remote_session | ||
| 12 | unbind_remote_session | ||
| 13 | unbind_remote_address | ||
| 14 | ); | ||
| 15 | |||
| 16 | # Show errors from perspective of caller | ||
| 17 | 1 | $Carp::Internal{(__PACKAGE__)}++; | |
| 18 | |||
| 19 | |||
| 20 | 0 | ▶ | sub bind_remote_session { |
|
Subroutine
bind_remote_session: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 21 | 0 | my ($self, %args) = @_; | |
| 22 | |||
| 23 | my $params = { | ||
| 24 | address => $args{'address'}, | ||
| 25 | caller_id => $self->{_CLIENT}->{caller_id}, | ||
| 26 | caller_addr => $self->{_CLIENT}->{caller_addr}, | ||
| 27 | auth_data => $self->{_CLIENT}->{auth_data}, | ||
| 28 | 0 | }; | |
| 29 | |||
| 30 | 0 | my $guard = $self->__use_authorization_token('BKPR_ROUTER'); | |
| 31 | |||
| 32 | $self->call_remote( | ||
| 33 | method => '_bkpr.router.bind', | ||
| 34 | params => $params, | ||
| 35 | 0 | timeout => $args{'timeout'}, | |
| 36 | ); | ||
| 37 | } | ||
| 38 | |||
| 39 | 0 | ▶ | sub bind_remote_session_async { |
|
Subroutine
bind_remote_session_async: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 40 | 0 | my ($self, %args) = @_; | |
| 41 | |||
| 42 | my $params = { | ||
| 43 | address => $args{'address'}, | ||
| 44 | caller_id => $self->{_CLIENT}->{caller_id}, | ||
| 45 | caller_addr => $self->{_CLIENT}->{caller_addr}, | ||
| 46 | auth_data => $self->{_CLIENT}->{auth_data}, | ||
| 47 | 0 | }; | |
| 48 | |||
| 49 | 0 | my $guard = $self->__use_authorization_token('BKPR_ROUTER'); | |
| 50 | |||
| 51 | $self->call_remote_async( | ||
| 52 | method => '_bkpr.router.bind', | ||
| 53 | params => $params, | ||
| 54 | timeout => $args{'timeout'}, | ||
| 55 | on_success => $args{'on_success'}, | ||
| 56 | 0 | on_error => $args{'on_error'}, | |
| 57 | ); | ||
| 58 | } | ||
| 59 | |||
| 60 | 0 | ▶ | sub unbind_remote_session { |
|
Subroutine
unbind_remote_session: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 61 | 0 | my ($self, %args) = @_; | |
| 62 | |||
| 63 | 0 | my $params = { caller_id => $self->{_CLIENT}->{caller_id} }; | |
| 64 | |||
| 65 | 0 | my $guard = $self->__use_authorization_token('BKPR_ROUTER'); | |
| 66 | |||
| 67 | $self->call_remote( | ||
| 68 | method => '_bkpr.router.unbind', | ||
| 69 | params => $params, | ||
| 70 | 0 | timeout => $args{'timeout'}, | |
| 71 | ); | ||
| 72 | } | ||
| 73 | |||
| 74 | 0 | ▶ | sub unbind_remote_session_async { |
|
Subroutine
unbind_remote_session_async: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 75 | 0 | my ($self, %args) = @_; | |
| 76 | |||
| 77 | 0 | my $params = { caller_id => $self->{_CLIENT}->{caller_id} }; | |
| 78 | |||
| 79 | 0 | my $guard = $self->__use_authorization_token('BKPR_ROUTER'); | |
| 80 | |||
| 81 | $self->call_remote_async( | ||
| 82 | method => '_bkpr.router.unbind', | ||
| 83 | params => $params, | ||
| 84 | timeout => $args{'timeout'}, | ||
| 85 | on_success => $args{'on_success'}, | ||
| 86 | 0 | on_error => $args{'on_error'}, | |
| 87 | ); | ||
| 88 | } | ||
| 89 | |||
| 90 | 0 | ▶ | sub unbind_remote_address { |
|
Subroutine
unbind_remote_address: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 91 | 0 | my ($self, %args) = @_; | |
| 92 | |||
| 93 | 0 | my $params = { address => $args{'address'} }; | |
| 94 | |||
| 95 | 0 | my $guard = $self->__use_authorization_token('BKPR_ROUTER'); | |
| 96 | |||
| 97 | $self->call_remote( | ||
| 98 | method => '_bkpr.router.unbind', | ||
| 99 | params => $params, | ||
| 100 | 0 | timeout => $args{'timeout'}, | |
| 101 | ); | ||
| 102 | } | ||
| 103 | |||
| 104 | 0 | ▶ | sub unbind_remote_address_async { |
|
Subroutine
unbind_remote_address_async: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 105 | 0 | my ($self, %args) = @_; | |
| 106 | |||
| 107 | 0 | my $params = { address => $args{'address'} }; | |
| 108 | |||
| 109 | 0 | my $guard = $self->__use_authorization_token('BKPR_ROUTER'); | |
| 110 | |||
| 111 | $self->call_remote_async( | ||
| 112 | method => '_bkpr.router.unbind', | ||
| 113 | params => $params, | ||
| 114 | timeout => $args{'timeout'}, | ||
| 115 | on_success => $args{'on_success'}, | ||
| 116 | 0 | on_error => $args{'on_error'}, | |
| 117 | ); | ||
| 118 | } | ||
| 119 | |||
| 120 | 1 | 1; | |
| 121 | |||
| 122 | __END__ | ||