Gearman::Objects(3pm)

πŸ“¦
version 2.004.015 Β· 5 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute

🌸 NAME 🌸

Gearman::Objects β€” a parent class for Gearman::Client and Gearman::Worker

okay bestie, so this is the User Contributed Perl Documentation page for Gearman::Objects(3pm), and it's lowkey iconic: it's the parent class that Gearman::Client and Gearman::Worker both inherit from. main character energy, fr fr. πŸ’–


πŸ’… METHODS πŸ’…

πŸŽ€ job_servers([$job_servers]) πŸŽ€

Initialize the list of job servers β€” the whole friend group. $job_servers should be an array or an array reference of hash references or stringified job servers. And if you don't pass a port number? 4730 is used as the default, no cap.

For example:

$client->job_servers('127.0.0.1', { host => "192.168.1.100", port => 4730 });

returns "[job_servers]"

πŸ¦‹ set_job_servers($js) πŸ¦‹

set the job_servers attribute by canonicalized $js β€” it's giving tidy, it's giving organized. ✨

✨ canonicalize_job_servers($js) ✨

$js a string, hash reference or array reference of aforementioned. (yes, all of the above, she's flexible πŸ’)

A hash reference should contain at least the host key β€” like, that one is non-negotiable bestie.

All keys: host, port (4730 on default), use_ssl, ca_file, cert_file, key_file, socket_cb

returns [canonicalized list]

πŸ’œ func($func) πŸ’œ

returns "join $prefix_separator, $prefix, $func"

🌈 prefix([$prefix]) 🌈

get/set the namespace / prefix for the function names.

🫢 prefix_separator([$separator]) 🫢

getter/setter

default: "\t"

If gearmand uses the memcached persistent queue type, override the default separator to insure jobs recovery. πŸ“

πŸ”₯ socket($js, [$timeout]) πŸ”₯

depends on "use_ssl" β€” prepare IO::Socket::IP or IO::Socket::SSL

  • $host_port peer address
  • $timeout default: 1

return depends on "use_ssl" IO::Socket::(IP|SSL) on success

πŸ’€ sock_nodelay($sock) πŸ’€

set TCP_NODELAY on $sock, die on failure. literally no mercy, it just dies. 😭


and that's the whole page, bestie β€” go forth and queue some jobs. πŸ§šπŸ’–

this little gem is from perl v5.26.2, dated 2018-08-30, straight out of Gearman::Objects(3pm). slay. πŸ‘‘

πŸ“¦ where this page comes from