Skip to content

Commit c4256f6

Browse files
committed
Client is now responsible for creating (truly) unique ActionIDs
1 parent 15fb662 commit c4256f6

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

src/Api.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,6 @@ private function boolParam($value)
110110

111111
private function request($name, array $args = array())
112112
{
113-
return $this->client->request(new Action($name, $args));
113+
return $this->client->request($this->client->createAction($name, $args));
114114
}
115115
}

src/Client.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ class Client extends EventEmitter
2020
private $pending = array();
2121
private $ending = false;
2222

23+
private $actionId = 0;
24+
2325
public function __construct(Stream $stream, Parser $parser = null)
2426
{
2527
if ($parser === null) {
@@ -124,4 +126,11 @@ public function isBusy()
124126
{
125127
return !!$this->pending;
126128
}
129+
130+
public function createAction($name, array $args = array())
131+
{
132+
$args = array('ActionID' => (string)++$this->actionId) + $args;
133+
134+
return new Action($name, $args);
135+
}
127136
}

0 commit comments

Comments
 (0)