Changeset View
Changeset View
Standalone View
Standalone View
src/conduit/ArcanistConduitEngine.php
| Show All 33 Lines | public function setConduitTimeout($conduit_timeout) { | ||||
| $this->conduitTimeout = $conduit_timeout; | $this->conduitTimeout = $conduit_timeout; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getConduitTimeout() { | public function getConduitTimeout() { | ||||
| return $this->conduitTimeout; | return $this->conduitTimeout; | ||||
| } | } | ||||
| public function newCall($method, array $parameters) { | public function newFuture($method, array $parameters) { | ||||
| if ($this->conduitURI == null && $this->client === null) { | if ($this->conduitURI == null && $this->client === null) { | ||||
| $this->raiseURIException(); | $this->raiseURIException(); | ||||
| } | } | ||||
| return id(new ArcanistConduitCall()) | |||||
| ->setEngine($this) | |||||
| ->setMethod($method) | |||||
| ->setParameters($parameters); | |||||
| } | |||||
| public function resolveCall($method, array $parameters) { | |||||
| return $this->newCall($method, $parameters)->resolve(); | |||||
| } | |||||
| public function newFuture(ArcanistConduitCall $call) { | |||||
| $method = $call->getMethod(); | |||||
| $parameters = $call->getParameters(); | |||||
| $future = $this->getClient()->callMethod($method, $parameters); | $future = $this->getClient()->callMethod($method, $parameters); | ||||
| return $future; | $call_future = id(new ArcanistConduitCallFuture($future)) | ||||
| ->setEngine($this); | |||||
| return $call_future; | |||||
| } | } | ||||
| private function getClient() { | private function getClient() { | ||||
| if (!$this->client) { | if (!$this->client) { | ||||
| $conduit_uri = $this->getConduitURI(); | $conduit_uri = $this->getConduitURI(); | ||||
| $client = new ConduitClient($conduit_uri); | $client = new ConduitClient($conduit_uri); | ||||
| ▲ Show 20 Lines • Show All 47 Lines • Show Last 20 Lines | |||||