… | |
… | |
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 | |
580 | Remove the request with the given isdentifier. Returns true if successful, |
602 | Remove 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; |