Skip to content

Commit

Permalink
fix: Reorder methods to make sure we do not lose a relay
Browse files Browse the repository at this point in the history
  • Loading branch information
L3tum committed Feb 6, 2024
1 parent f366338 commit 4605e3f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/RPC/MultiRPC.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ public function call(string $method, mixed $payload, mixed $options = null): mix
public function callIgnoreResponse(string $method, mixed $payload): void
{
$relay = $this->getNextFreeRelay();
$relay->send($this->packFrame($method, $payload));
$this->occupiedRelaysIgnoreResponse[] = $relay;
$relay->send($this->packFrame($method, $payload));
self::$seq++;
}

Expand All @@ -138,11 +138,13 @@ public function callAsync(string $method, mixed $payload): int
}

$relay = $this->getNextFreeRelay();
$relay->send($this->packFrame($method, $payload));
$seq = self::$seq;
self::$seq++;
$this->occupiedRelays[$seq] = $relay;
$this->seqToRelayMap[$seq] = $relay;

$relay->send($this->packFrame($method, $payload));

return $seq;
}

Expand Down

0 comments on commit 4605e3f

Please sign in to comment.