Net_Gearman
[ class tree: Net_Gearman ] [ index: Net_Gearman ] [ all elements ]

Class: Net_Gearman_Client

Source Location: /Net_Gearman-0.2.3/Net/Gearman/Client.php

Class Overview


A client for submitting jobs to Gearman


Author(s):

Copyright:

  • 2007-2008 Digg.com, Inc.

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 40]
A client for submitting jobs to Gearman

This class is used by code submitting jobs to the Gearman server. It handles taking tasks and sets of tasks and submitting them to the Gearman server.



[ Top ]


Class Variables

$conn = array()

[line 47]

Our randomly selected connection
  • Var: An open socket to Gearman
  • Access: protected

Type:   resource


[ Top ]

$servers = array()

[line 54]

A list of Gearman servers
  • Var: A list of potential Gearman servers
  • Access: protected

Type:   array


[ Top ]

$timeout =  1000

[line 61]

The timeout for Gearman connections
  • Access: protected

Type:   integer


[ Top ]



Method Detail

__construct (Constructor)   [line 73]

void __construct( array $servers, [integer $timeout = 1000])

Constructor

Parameters:

array   $servers     An array of servers or a single server
integer   $timeout     Timeout in microseconds

[ Top ]

__destruct (Destructor)   [line 284]

void __destruct( )

Destructor
  • Access: public

[ Top ]

disconnect   [line 268]

void disconnect( )

Disconnect from Gearman
  • Access: public

[ Top ]

getConnection   [line 100]

resource getConnection( )

Get a connection to a Gearman server
  • Return: A connection to a Gearman server
  • Access: protected

[ Top ]

handleResponse   [line 225]

void handleResponse( array $resp, resource $s, Net_Gearman_Set $tasks)

Handle the response read in
  • Throws: Net_Gearman_Exception
  • Access: protected

Parameters:

array   $resp     The raw array response
resource   $s     The socket
object   $tasks     The tasks being ran

[ Top ]

runSet   [line 184]

void runSet( Net_Gearman_Set $set)

Run a set of tasks

Parameters:

object   $set     A set of tasks to run

[ Top ]

submitTask   [line 138]

void submitTask( Net_Gearman_Task $task)

Submit a task to Gearman

Parameters:

object   $task     Task to submit to Gearman

[ Top ]

__call   [line 114]

void __call( string $func, [ $args = array()])

Fire off a background task with the given arguments

Parameters:

string   $func     Name of job to run
array   $args     First key should be args to send

[ Top ]


Documentation generated on Wed, 22 Apr 2009 21:30:03 +0000 by phpDocumentor 1.4.2. PEAR Logo Copyright © PHP Group 2004.