1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-25 16:22:42 +01:00
phorge-arcanist/src/conduit/FutureAgent.php
epriestley 01e91dc260 Clean up some service profiler behavior in Conduit futures
Summary:
Correct two minor Conduit future issues:

  - FutureAgent shows up in the trace log as "<mystery>". Since it isn't doing anything useful, solve the mystery and drop it from the log.
  - Simply the ConduitFuture code for interacting with the service profiler now that a more structured integration is available.

Test Plan: Ran "arc branches --trace", saw conduit calls and no more "<mystery>" clutter.

Differential Revision: https://secure.phabricator.com/D21388
2020-07-01 06:37:31 -07:00

45 lines
1,006 B
PHP

<?php
abstract class FutureAgent
extends Future {
private $futures = array();
final protected function setFutures(array $futures) {
$this->futures = $futures;
}
final protected function getFutures() {
return $this->futures;
}
final public function getReadSockets() {
$sockets = array();
foreach ($this->getFutures() as $future) {
foreach ($future->getReadSockets() as $read_socket) {
$sockets[] = $read_socket;
}
}
return $sockets;
}
final public function getWriteSockets() {
$sockets = array();
foreach ($this->getFutures() as $future) {
foreach ($future->getWriteSockets() as $read_socket) {
$sockets[] = $read_socket;
}
}
return $sockets;
}
protected function getServiceProfilerStartParameters() {
// At least today, the agent construct doesn't add anything interesting
// to the trace and the underlying futures always show up in the trace
// themselves.
return null;
}
}