protected static function chainApply(&$promise, $chain = [])
    {
        foreach ($chain as $row) {
            $promise = call_user_func_array([$promise, $row['method']], $row['arguments']);
        }
    }