1Gearman::Server(3)    User Contributed Perl Documentation   Gearman::Server(3)
2
3
4

NAME

6       Gearman::Server - function call "router" and load balancer
7

DESCRIPTION

9       You run a Gearman server (or more likely, many of them for both high-
10       availability and load balancing), then have workers (using
11       Gearman::Worker from the Gearman module, or libraries for other
12       languages) register their ability to do certain functions to all of
13       them, and then clients (using Gearman::Client, Gearman::Client::Async,
14       etc) request work to be done from one of the Gearman servers.
15
16       The servers connect them, routing function call requests to the
17       appropriate workers, multiplexing responses to duplicate requests as
18       requested, etc.
19
20       More than likely, you want to use the provided "gearmand" in bin
21       wrapper script, and not use Gearman::Server directly.
22

METHODS

24   new
25         $server_object = Gearman::Server->new( %options )
26
27       Creates and returns a new Gearman::Server object, which attaches itself
28       to the Danga::Socket event loop. The server will begin operating when
29       the Danga::Socket runloop is started. This means you need to start up
30       the runloop before anything will happen.
31
32       Options:
33
34       port
35           Specify a port which you would like the Gearman::Server to listen
36           on for TCP connections (not necessary, but useful)
37
38   create_listening_sock
39         $server_object->create_listening_sock( $portnum, \%options )
40
41       Add a TCP port listener for incoming Gearman worker and client
42       connections.  Options:
43
44       accept_per_loop
45       local_addr
46           Bind socket to only this address.
47
48   start_worker
49         $pid = $server_object->start_worker( $prog )
50
51         ($pid, $client) = $server_object->start_worker( $prog )
52
53       Fork and start a worker process named by $prog and returns the pid (or
54       pid and client object).
55

SEE ALSO

57       "gearmand" in bin
58
59
60
61perl v5.32.0                      2020-07-28                Gearman::Server(3)
Impressum