src/threadsafeclient.php
public function pubbatch($reqs)
    {
        if (count($reqs) == 0)
            throw new \RuntimeException('reqs length == 0');
        $uri = $reqs[0][0];
        $auth_header = $reqs[0][1];
        $items = array();
        $callbacks = array();
        foreach ($reqs as $req)
        {
            $items[] = $req[2];
            $callbacks[] = $req[3];
        }
        $result = null;
        try
        {
            $this->pcc_utilities->pubcall($uri, $auth_header, $items);
            $result = array(true, '');
        }
        catch (\RuntimeException $exception)
        {
            $result = array(false, $exception->getMessage());
        }
        foreach ($callbacks as $callback)
            if (!is_null($callback))
            {
                call_user_func($callback, $result[0], $result[1]);
            }
    }
public function pubbatch($reqs)
    {
        if (count($reqs) == 0)
            throw new \RuntimeException('reqs length == 0');
        $uri = $reqs[0][0];
        $auth_header = $reqs[0][1];
        $items = array();
        $callbacks = array();
        foreach ($reqs as $req)
        {
            $items[] = $req[2];
            $callbacks[] = $req[3];
        }
        $result = null;
        try
        {
            $this->pcc_utilities->pubcall($uri, $auth_header, $items);
            $result = array(true, '');
        }
        catch (\RuntimeException $exception)
        {
            $result = array(false, $exception->getMessage());
        }
        foreach ($callbacks as $callback)
            if (!is_null($callback))
            {
                call_user_func($callback, $result[0], $result[1]);
            }
    }
request was successfully published.