NAME

Net::Clacks::Client - client for CLACKS interprocess messaging

SYNOPSIS

  use Net::Clacks::Client;

DESCRIPTION

This implements the client network protocol for the CLACKS interprocess messaging. This is used a lot in PageCamel projects to let different processes (workers, webgui, PageCamelSVC) communicate with each other

new

Create a new instance.

reconnect

Reconnect to the CLACKS server when something went wrong.

doNetwork

Process incoming and outpoing messages. doNetwork tries to send as much as possible. But due to network congestion it might not be able to send everything in one go and it will try not to hold up the caller for too long. Thats why it's important to call doNetwork from the cyclic loop of your programm at least every few seconds or so (depending on what you are trying to do).

flush

Send everything in the client out queue to the server and wait for a confirmation from the server it has recieved everything. This is a syncronous operation and will hold up the calling program.

ping

Send a PING (keepalive) packet.

disablePing

Temporarly disable auto-disconnects by the server (NOPING command). Useful before doing something with indeterminate length (long running functions and such).

notify

NOTIFY other clients via CLACKS that an event happened.

set

SET a value for a CLACKS variable to other clients.

listen

LISTEN to specific NOTIFY and SET events.

unlisten

Stop listening to specific NOTIFY and SET events.

store

STORE a value in clacks for later retrieval.

retrieve

RETRIEVE a values from clacks that has been stored earlier.

increment

INCREMENT a stored value by one. Takes an optional argument to say how much to increment.

decrement

DECREMENT a stored value by one. Takes an optional argument to say how much to decrement.

remove

REMOVE/DELETE a stored key from clacks

keylist

Get a list of all keys stored in clacks.

clearcache

Remove all keys stored in clacks.

setAndStore

Meta-function that both calls set() and store() internally with a single library call. Useful in some circumstances when you both want to remember the variable and also tell everyone interested immediately that it has changed.

setMonitormode

Enable/Disable monitor mode. When enabled, the server sends all events it sees as DEBUG events (events LISTENed to also get send the normal way).

getServerinfo

Get server name and version.

getNext

Get the next incoming event in the queue.

clientlist

Get a list of all clients connected to the server. If the server is using interclacks (multiple servers in a pool), it will only list the clients connected to the server you are connected to.

sendRawCommand

Adds whatever you want to the out queue, to be send to the server. This is mostly useful when debugging and/or enhancing your server or if you want to implement a command line shell to your clacks server-

activate_memcached_compat

This activates a sort of memcached compatibility setup. Don't use this directly, it's an internal wonky workaround. Use Net::Clacks::ClacksCache instead.

autohandle_messages

This is also part of the internal memcached compatibility setup. Don't use this directly.

DESTROY

Automatically closes the connection.

IMPORTANT NOTE

Please make sure and read the documentations for Net::Clacks as it contains important information pertaining to upgrades and general changes!

AUTHOR

Rene Schickbauer, <cavac@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2008-2019 Rene Schickbauer

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.