… | |
… | |
78 | |
78 | |
79 | $cl->reg_cb ( |
79 | $cl->reg_cb ( |
80 | error => sub { |
80 | error => sub { |
81 | my ($cl, $acc, $err) = @_; |
81 | my ($cl, $acc, $err) = @_; |
82 | print "ERROR: " . $err->string . "\n"; |
82 | print "ERROR: " . $err->string . "\n"; |
83 | 1 |
|
|
84 | }, |
83 | }, |
85 | iq_result_cb_exception => sub { |
84 | iq_result_cb_exception => sub { |
86 | my ($cl, $acc, $ex) = @_; |
85 | my ($cl, $acc, $ex) = @_; |
87 | print "EXCEPTION: $ex\n"; |
86 | print "EXCEPTION: $ex\n"; |
88 | 1 |
|
|
89 | }, |
87 | }, |
90 | session_ready => sub { |
88 | session_ready => sub { |
91 | my ($cl, $acc) = @_; |
89 | my ($cl, $acc) = @_; |
92 | print "session ready, requesting items for $ARGV[0]\n"; |
90 | print "session ready, requesting items for $ARGV[0]\n"; |
93 | my $c = $acc->connection (); |
91 | my $c = $acc->connection (); |
… | |
… | |
124 | } |
122 | } |
125 | ); |
123 | ); |
126 | |
124 | |
127 | $timer_cnt += $timer_step; |
125 | $timer_cnt += $timer_step; |
128 | } |
126 | } |
129 | 0 |
127 | $cl->unreg_me; |
130 | }, |
128 | }, |
131 | message => sub { |
129 | message => sub { |
132 | my ($cl, $acc, $msg) = @_; |
130 | my ($cl, $acc, $msg) = @_; |
133 | print "message from: " . $msg->from . ": " . $msg->any_body . "\n"; |
131 | print "message from: " . $msg->from . ": " . $msg->any_body . "\n"; |
134 | 1 |
|
|
135 | } |
132 | } |
136 | ); |
133 | ); |
137 | |
134 | |
138 | $cl->start; |
135 | $cl->start; |
139 | |
136 | |