ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-FCP/FCP.pm
(Generate patch)

Comparing AnyEvent-FCP/FCP.pm (file contents):
Revision 1.12 by root, Sat Aug 8 04:02:48 2015 UTC vs.
Revision 1.13 by root, Sat Aug 8 04:07:28 2015 UTC

517 ); 517 );
518 518
519 $self->on (sub { 519 $self->on (sub {
520 my ($self, $type, $kv, @extra) = @_; 520 my ($self, $type, $kv, @extra) = @_;
521 521
522 $guard if 0;
523
522 if ($kv->{identifier} eq $identifier) { 524 if ($kv->{identifier} eq $identifier) {
523 if ($type eq "persistent_request_modified") { 525 if ($type eq "persistent_request_modified") {
524 $ok->($kv); 526 $ok->($kv);
525 return; 527 return;
526 } elsif ($type eq "protocol_error") { 528 } elsif ($type eq "protocol_error") {
564=cut 566=cut
565 567
566_txn client_get => sub { 568_txn client_get => sub {
567 my ($self, $ok, $err, $uri, $identifier, %kv) = @_; 569 my ($self, $ok, $err, $uri, $identifier, %kv) = @_;
568 570
571 $self->serialise ($identifier => sub {
572 my ($self, $guard) = @_;
573
569 $self->send_msg (client_get => 574 $self->send_msg (client_get =>
570 %kv, 575 %kv,
571 uri => $uri, 576 uri => $uri,
572 identifier => $identifier, 577 identifier => $identifier,
578 );
579
580 $self->on (sub {
581 my ($self, $type, $kv, @extra) = @_;
582
583 $guard if 0;
584
585 if ($kv->{identifier} eq $identifier) {
586 if ($type eq "persistent_get") {
587 $ok->($kv);
588 return;
589 } elsif ($type eq "protocol_error") {
590 $err->($kv);
591 return;
592 }
593 }
594
595 1
596 });
573 ); 597 });
574
575 $ok->();
576}; 598};
577 599
578=item $status = $fcp->remove_request ($identifier[, $global]) 600=item $status = $fcp->remove_request ($identifier[, $global])
579 601
580Remove the request with the given isdentifier. Returns true if successful, 602Remove the request with the given isdentifier. Returns true if successful,
592 identifier => $identifier, 614 identifier => $identifier,
593 global => $global ? "true" : "false", 615 global => $global ? "true" : "false",
594 ); 616 );
595 $self->on (sub { 617 $self->on (sub {
596 my ($self, $type, $kv, @extra) = @_; 618 my ($self, $type, $kv, @extra) = @_;
619
620 $guard if 0;
597 621
598 if ($kv->{identifier} eq $identifier) { 622 if ($kv->{identifier} eq $identifier) {
599 if ($type eq "persistent_request_removed") { 623 if ($type eq "persistent_request_removed") {
600 $ok->(1); 624 $ok->(1);
601 return; 625 return;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines