coud
9/16/2011 - 5:10 AM

pecl gearman classes code completion for NetBeans

pecl gearman classes code completion for NetBeans

<?php

/**
 * for code completion
 * 
 * @link http://docs.php.net/manual/en/book.gearman.php
 */
if (false) {

    define('GEARMAN_SUCCESS', 0);
    define('GEARMAN_IO_WAIT', 1);
    define('GEARMAN_SHUTDOWN', 2);
    define('GEARMAN_SHUTDOWN_GRACEFUL', 3);
    define('GEARMAN_ERRNO', 4);
    define('GEARMAN_EVENT', 5);
    define('GEARMAN_TOO_MANY_ARGS', 6);
    define('GEARMAN_NO_ACTIVE_FDS', 7);
    define('GEARMAN_INVALID_MAGIC', 8);
    define('GEARMAN_INVALID_COMMAND', 9);
    define('GEARMAN_INVALID_PACKET', 10);
    define('GEARMAN_UNEXPECTED_PACKET', 11);
    define('GEARMAN_GETADDRINFO', 12);
    define('GEARMAN_NO_SERVERS', 13);
    define('GEARMAN_LOST_CONNECTION', 14);
    define('GEARMAN_MEMORY_ALLOCATION_FAILURE', 15);
    define('GEARMAN_JOB_EXISTS', 16);
    define('GEARMAN_JOB_QUEUE_FULL', 17);
    define('GEARMAN_SERVER_ERROR', 18);
    define('GEARMAN_WORK_ERROR', 19);
    define('GEARMAN_WORK_DATA', 20);
    define('GEARMAN_WORK_WARNING', 21);
    define('GEARMAN_WORK_STATUS', 22);
    define('GEARMAN_WORK_EXCEPTION', 23);
    define('GEARMAN_WORK_FAIL', 24);
    define('GEARMAN_NOT_CONNECTED', 25);
    define('GEARMAN_COULD_NOT_CONNECT', 26);
    define('GEARMAN_SEND_IN_PROGRESS', 27);
    define('GEARMAN_RECV_IN_PROGRESS', 28);
    define('GEARMAN_NOT_FLUSHING', 29);
    define('GEARMAN_DATA_TOO_LARGE', 30);
    define('GEARMAN_INVALID_FUNCTION_NAME', 31);
    define('GEARMAN_INVALID_WORKER_FUNCTION', 32);
    define('GEARMAN_NO_REGISTERED_FUNCTIONS', 34);
    define('GEARMAN_NO_JOBS', 35);
    define('GEARMAN_ECHO_DATA_CORRUPTION', 36);
    define('GEARMAN_NEED_WORKLOAD_FN', 37);
    define('GEARMAN_PAUSE', 38);
    define('GEARMAN_UNKNOWN_STATE', 39);
    define('GEARMAN_PTHREAD', 40);
    define('GEARMAN_PIPE_EOF', 41);
    define('GEARMAN_QUEUE_ERROR', 42);
    define('GEARMAN_FLUSH_DATA', 43);
    define('GEARMAN_SEND_BUFFER_TOO_SMALL', 44);
    define('GEARMAN_IGNORE_PACKET', 45);
    define('GEARMAN_UNKNOWN_OPTION', 46);
    define('GEARMAN_TIMEOUT', 47);
    define('GEARMAN_MAX_RETURN', 49);

    /**
     * @return string
     */
    function gearman_version() {
        
    }

    /**
     * The GearmanClient class 
     *
     * @link http://docs.php.net/manual/en/class.gearmanclient.php
     *
     * @method GearmanClient clone()<br />
     *     Create a copy of a GearmanClient object<br />
     *     http://docs.php.net/manual/en/gearmanclient.clone.php
     * @method string        do(string $function_name string $workload, string $unique)<br />
     *     Run a single task and return a result<br />
     *     http://docs.php.net/manual/en/gearmanclient.do.php
     * @method int           echo(string $workload)<br />
     *     Send data to all job servers to see if they echo it back<br />
     *     http://docs.php.net/manual/en/gearmanclient.echo.php
     */
    class GearmanClient {

        /**
         * Create a GearmanClient instance
         *
         * @link http://docs.php.net/manual/en/gearmanclient.construct.php
         */
        public function __construct();

        /**
         * Add client options
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanclient.addoptions.php
         */
        public function addOptions(int $options);

        /**
         * Add a job server to the client
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanclient.addserver.php
         */
        public function addServer(string $host = '127.0.0.1', int $port = 4730);

        /**
         * Add a list of job servers to the client
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanclient.addservers.php
         */
        public function addServers(string $servers = '127.0.0.1:4730');

        /**
         * Add a task to be run in parallel
         *
         * @return GearmanTask
         * @link http://docs.php.net/manual/en/gearmanclient.addtask.php
         */
        public function addTask(string $function_name, string $workload, mixed &$context, string $unique);

        /**
         * Add a background task to be run in parallel
         *
         * @return GearmanTask
         * @link http://docs.php.net/manual/en/gearmanclient.addtaskbackground.php
         */
        public function addTaskBackground(string $function_name, string $workload, mixed &$context, string $unique);

        /**
         * Add a high priority task to run in parallel
         *
         * @return GearmanTask
         * @link http://docs.php.net/manual/en/gearmanclient.addtaskhigh.php
         */
        public function addTaskHigh(string $function_name, string $workload, mixed &$context, string $unique);

        /**
         * Add a high priority background task to be run in parallel
         *
         * @return GearmanTask
         * @link http://docs.php.net/manual/en/gearmanclient.addtaskhighbackground.php
         */
        public function addTaskHighBackground(string $function_name, string $workload, mixed &$context, string $unique);

        /**
         * Add a low priority task to run in parallel
         *
         * @return GearmanTask
         * @link http://docs.php.net/manual/en/gearmanclient.addtasklow.php
         */
        public function addTaskLow(string $function_name, string $workload, mixed &$context, string $unique);

        /**
         * Add a low priority background task to be run in parallel
         *
         * @return GearmanTask
         * @link http://docs.php.net/manual/en/gearmanclient.addtasklowbackground.php
         */
        public function addTaskLowBackground(string $function_name, string $workload, mixed &$context, string $unique);

        /**
         * Add a task to get status
         *
         * @return GearmanTask
         * @link http://docs.php.net/manual/en/gearmanclient.addtaskstatus.php
         */
        public function addTaskStatus(string $job_handle, string &$context);

        /**
         * Clear all task callback functions
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanclient.clearcallbacks.php
         */
        public function clearCallbacks();

        /**
         * Create a copy of a GearmanClient object
         *
         * @return GearmanClient
         * @link http://docs.php.net/manual/en/gearmanclient.clone.php
         */
        //public function clone();
        /**
         * Get the application context
         *
         * @return string
         * @link http://docs.php.net/manual/en/gearmanclient.context.php
         */
        public function context();

        /**
         * Get the application data (deprecated)
         *
         * @return string
         * @deprecated
         * @link http://docs.php.net/manual/en/gearmanclient.data.php
         */
        public function data();

        /**
         * Run a single task and return a result
         *
         * @return string
         * @link http://docs.php.net/manual/en/gearmanclient.do.php
         */
        //public function do(string $function_name, string $workload, string $unique);
        /**
         * Run a task in the background
         *
         * @return string
         * @link http://docs.php.net/manual/en/gearmanclient.dobackground.php
         */
        public function doBackground(string $function_name, string $workload, string $unique);

        /**
         * Run a single high priority task
         *
         * @return string
         * @link http://docs.php.net/manual/en/gearmanclient.dohigh.php
         */
        public function doHigh(string $function_name, string $workload, string $unique);

        /**
         * Run a high priority task in the background
         *
         * @return string
         * @link http://docs.php.net/manual/en/gearmanclient.dohighbackground.php
         */
        public function doHighBackground(string $function_name, string $workload, string $unique);

        /**
         * Get the job handle for the running task
         *
         * @return string
         * @link http://docs.php.net/manual/en/gearmanclient.dojobhandle.php
         */
        public function doJobHandle();

        /**
         *  Run a single low priority task
         *
         * @return string
         * @link http://docs.php.net/manual/en/gearmanclient.dolow.php
         */
        public function doLow(string $function_name, string $workload, string $unique);

        /**
         * Run a low priority task in the background
         *
         * @return string
         * @link http://docs.php.net/manual/en/gearmanclient.dolowbackground.php
         */
        public function doLowBackground(string $function_name, string $workload, string $unique);

        /**
         * Get the status for the running task
         *
         * @return array
         * @link http://docs.php.net/manual/en/gearmanclient.dostatus.php
         */
        public function doStatus();
        /**
         * Send data to all job servers to see if they echo it back
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanclient.echo.php
         */
        //public function echo(string $workload);

        /**
         * Returns an error string for the last error encountered.
         *
         * @return string
         * @link http://docs.php.net/manual/en/gearmanclient.error.php
         */
        public function error();

        /**
         * Get an errno value
         *
         * @return int
         * @link http://docs.php.net/manual/en/gearmanclient.geterrno.php
         */
        public function getErrno();

        /**
         * Get the status of a background job
         *
         * @return array
         * @link http://docs.php.net/manual/en/gearmanclient.jobstatus.php
         */
        public function jobStatus(string $job_handle);

        /**
         * Remove client options
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanclient.removeoptions.php
         */
        public function removeOptions(int $options);

        /**
         * Get the last Gearman return code
         *
         * @return int
         * @link http://docs.php.net/manual/en/gearmanclient.returncode.php
         */
        public function returnCode();

        /**
         * Run a list of tasks in parallel
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanclient.runtasks.php
         */
        public function runTasks();

        /**
         * Callback function when there is a data packet for a task (deprecated)
         *
         *  @deprecated
         * @link http://docs.php.net/manual/en/gearmanclient.setclientcallback.php
         */
        public function setClientCallback(callback $callback);

        /**
         * Set a function to be called on task completion
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanclient.setcompletecallback.php
         */
        public function setCompleteCallback(callback $callback);

        /**
         * Set application context
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanclient.setcontext.php
         */
        public function setContext(string $context);

        /**
         * Set a callback for when a task is queued
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanclient.setcreatedcallback.php
         */
        public function setCreatedCallback(string $callback);

        /**
         * Set application data (deprecated)
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanclient.setdata.php
         * @deprecated
         */
        public function setData(string $data);

        /**
         * Callback function when there is a data packet for a task
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanclient.setdatacallback.php
         */
        public function setDataCallback(callback $callback);

        /**
         * Set a callback for worker exceptions
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanclient.setexceptioncallback.php
         */
        public function setExceptionCallback(callback $callback);

        /**
         * Set callback for job failure
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanclient.setfailcallback.php
         */
        public function setFailCallback(callback $callback);

        /**
         * Set client options
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanclient.setoptions.php
         */
        public function setOptions(int $options);

        /**
         * Set a callback for collecting task status
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanclient.setstatuscallback.php
         */
        public function setStatusCallback(callback $callback);

        /**
         * Set socket I/O activity timeout
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanclient.settimeout.php
         */
        public function setTimeout(int $timeout);

        /**
         * Set a callback for worker warnings
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanclient.setwarningcallback.php
         */
        public function setWarningCallback(callback $callback);

        /**
         * Set a callback for accepting incremental data updates
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanclient.setworkloadcallback.php
         */
        public function setWorkloadCallback(callback $callback);

        /**
         * Get current socket I/O activity timeout value
         *
         * @return int
         * @link http://docs.php.net/manual/en/gearmanclient.timeout.php
         */
        public function timeout();
    }

    /**
     * @link http://docs.php.net/manual/en/class.gearmanjob.php
     */
    class GearmanJob {

        /**
         * Create a GearmanJob instance
         *
         * @link http://docs.php.net/manual/en/gearmanjob.construct.php
         */
        public function __construct();

        /**
         * Send the result and complete status (deprecated)
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanjob.complete.php
         * @deprecated
         */
        public function complete(string $result);

        /**
         * Send data for a running job (deprecated)
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanjob.data.php
         * @deprecated
         */
        public function data(string $data);

        /**
         * Send exception for running job (deprecated)
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanjob.exception.php
         * @deprecated
         */
        public function exception(string $exception);

        /**
         *  Send fail status (deprecated)
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanjob.fail.php
         * @deprecated
         */
        public function fail();

        /**
         * Get function name
         *
         * @return string
         * @link http://docs.php.net/manual/en/gearmanjob.functionname.php
         */
        public function functionName();

        /**
         * Get the job handle
         *
         * @return string
         * @link http://docs.php.net/manual/en/gearmanjob.handle.php
         */
        public function handle();

        /**
         * Get last return code
         *
         * @return int
         * @link http://docs.php.net/manual/en/gearmanjob.returncode.php
         */
        public function returnCode();

        /**
         * Send the result and complete status
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanjob.sendcomplete.php
         */
        public function sendComplete(string $result);

        /**
         *  Send data for a running job
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanjob.senddata.php
         */
        public function sendData(string $data);

        /**
         * Send exception for running job (exception)
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanjob.sendexception.php
         */
        public function sendException(string $exception);

        /**
         * Send fail status
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanjob.sendfail.php
         */
        public function sendFail();

        /**
         * Send status
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanjob.sendstatus.php
         */
        public function sendStatus(int $numerator, int $denominator);

        /**
         * Send a warning
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanjob.sendwarning.php
         */
        public function sendWarning(string $warning);

        /**
         * Set a return value
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanjob.setreturn.php
         */
        public function setReturn(int $gearman_return_t);

        /**
         * Send status (deprecated)
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanjob.status.php
         * @deprecated
         */
        public function status(int $numerator, int $denominator);

        /**
         * Get the unique identifier
         *
         * @return string
         * @link http://docs.php.net/manual/en/gearmanjob.unique.php
         */
        public function unique();

        /**
         * Send a warning (deprecated)
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanjob.warning.php
         * @deprecated
         */
        public function warning(string $warning);

        /**
         * Get workload
         *
         * @return string
         * @link http://docs.php.net/manual/en/gearmanjob.workload.php
         */
        public function workload();

        /**
         * Get size of work load
         *
         * @return int
         * @link http://docs.php.net/manual/en/gearmanjob.workloadsize.php
         */
        public function workloadSize();
    }

    /**
     * @link http://docs.php.net/manual/en/class.gearmantask.php
     * 
     * @method string function()<br />
     *     Get associated function name (deprecated)<br />
     *     http://docs.php.net/manual/en/gearmantask.function.php
     */
    class GearmanTask {

        /**
         * Create a GearmanTask instance
         * 
         * @link http://docs.php.net/manual/en/gearmantask.construct.php
         */
        public function __construct();

        /**
         * Create a task (deprecated)
         *
         * @return GearmanTask
         * @link http://docs.php.net/manual/en/gearmantask.create.php
         * @deprecated
         */
        public function create();

        /**
         * Get data returned for a task
         *
         * @return string
         * @link http://docs.php.net/manual/en/gearmantask.data.php
         */
        public function data();

        /**
         * Get the size of returned data
         *
         * @return int
         * @link http://docs.php.net/manual/en/gearmantask.datasize.php
         */
        public function dataSize();
        /**
         * Get associated function name (deprecated)
         *
         * @return string
         * @link http://docs.php.net/manual/en/gearmantask.function.php
         * @deprecated
         */
        //public function function ( );

        /**
         * Get associated function name
         *
         * @return string
         * @link http://docs.php.net/manual/en/gearmantask.functionname.php
         */
        public function functionName();

        /**
         * Determine if task is known
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmantask.isknown.php
         */
        public function isKnown();

        /**
         * Test whether the task is currently running
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmantask.isrunning.php
         */
        public function isRunning();

        /**
         * Get the job handle
         *
         * @return string
         * @link http://docs.php.net/manual/en/gearmantask.jobhandle.php
         */
        public function jobHandle();

        /**
         * Read work or result data into a buffer for a task
         *
         * @return array
         * @link http://docs.php.net/manual/en/gearmantask.recvdata.php
         */
        public function recvData(int $data_len);

        /**
         * Get the last return code
         *
         * @return int
         * @link http://docs.php.net/manual/en/gearmantask.returncode.php
         */
        public function returnCode();

        /**
         * Send data for a task (deprecated)
         *
         * @return int
         * @link http://docs.php.net/manual/en/gearmantask.senddata.php
         * @deprecated
         */
        public function sendData(string $data);

        /**
         * Send data for a task
         *
         * @return int
         * @link http://docs.php.net/manual/en/gearmantask.sendworkload.php
         */
        public function sendWorkload(string $data);

        /**
         * Get completion percentage denominator
         *
         * @return int
         * @link http://docs.php.net/manual/en/gearmantask.taskdenominator.php
         */
        public function taskDenominator();

        /**
         * Get completion percentage numerator
         *
         * @return int
         * @link http://docs.php.net/manual/en/gearmantask.tasknumerator.php
         */
        public function taskNumerator();

        /**
         * Get the unique identifier for a task
         *
         * @return string
         * @link http://docs.php.net/manual/en/gearmantask.unique.php
         */
        public function unique();

        /**
         * Get the unique identifier for a task (deprecated)
         *
         * @return string
         * @link http://docs.php.net/manual/en/gearmantask.uuid.php
         * @deprecated
         */
        public function uuid();
    }

    /**
     * The GearmanWorker class 
     *
     * @link http://docs.php.net/manual/en/class.gearmanworker.php
     * 
     * @method GearmanWorker clone()<br />
     *     Create a copy of the worker<br />
     *     http://docs.php.net/manual/en/gearmanworker.clone.php
     * @method int           echo(string $workload)<br />
     *     Test job server response<br />
     *     http://docs.php.net/manual/en/gearmanworker.echo.php
     */
    class GearmanWorker {

        /**
         * Create a GearmanWorker instance
         *
         * @link http://docs.php.net/manual/en/gearmanworker.construct.php
         */
        public function __construct();

        /**
         * Register and add callback function
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanworker.addfunction.php
         */
        public function addFunction(string $function_name, callback $function, mixed &$context, int $timeout);

        /**
         * Add worker options
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanworker.addoptions.php
         */
        public function addOptions(int $option);

        /**
         * Add a job server
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanworker.addserver.php
         */
        public function addServer(string $host = '127.0.0.1', int $port = 4730);

        /**
         *  Add job servers
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanworker.addservers.php
         */
        public function addServers(string $servers = '127.0.0.1:4730');

        /**
         * Create a copy of the worker
         *
         * @return GearmanWorker
         * @link http://docs.php.net/manual/en/gearmanworker.clone.php
         */
        //public function clone();
        /**
         * Test job server response
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanworker.echo.php
         */
        //public function echo(string $workload);
        /**
         * Get the last error encountered
         *
         * @return string
         * @link http://docs.php.net/manual/en/gearmanworker.error.php
         */
        public function error();

        /**
         * Get errno
         *
         * @return int
         * @link http://docs.php.net/manual/en/gearmanworker.geterrno.php
         */
        public function getErrno();

        /**
         * Get worker options
         *
         * @return int
         * @link http://docs.php.net/manual/en/gearmanworker.options.php
         */
        public function options();

        /**
         * Register a function with the job server
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanworker.register.php
         */
        public function register(string $function_name, int $timeout);

        /**
         * Remove worker options
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanworker.removeoptions.php
         */
        public function removeOptions(int $option);

        /**
         * Get last Gearman return code
         *
         * @return int
         * @link http://docs.php.net/manual/en/gearmanworker.returncode.php
         */
        public function returnCode();

        /**
         * Set worker options
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanworker.setoptions.php
         */
        public function setOptions(int $option);

        /**
         * Set socket I/O activity timeout
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanworker.settimeout.php
         */
        public function setTimeout(int $timeout);

        /**
         * Get socket I/O activity timeout
         *
         * @return int
         * @link http://docs.php.net/manual/en/gearmanworker.timeout.php
         */
        public function timeout();

        /**
         * Unregister a function name with the job servers
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanworker.unregister.php
         */
        public function unregister(string $function_name);

        /**
         * Unregister all function names with the job servers
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanworker.unregisterall.php
         */
        public function unregisterAll();

        /**
         * Wait for activity from one of the job servers
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanworker.wait.php
         */
        public function wait();

        /**
         * Wait for and perform jobs
         *
         * @return bool
         * @link http://docs.php.net/manual/en/gearmanworker.work.php
         */
        public function work();
    }

}