- IMPORTANT NOTE
- COPYRIGHT AND LICENSE
Net::Clacks::Client - client for CLACKS interprocess messaging
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
Create a new instance.
Reconnect to the CLACKS server when something went wrong.
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).
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.
Send a PING (keepalive) packet.
Temporarly disable auto-disconnects by the server (NOPING command). Useful before doing something with indeterminate length (long running functions and such).
NOTIFY other clients via CLACKS that an event happened.
SET a value for a CLACKS variable to other clients.
LISTEN to specific NOTIFY and SET events.
Stop listening to specific NOTIFY and SET events.
STORE a value in clacks for later retrieval.
RETRIEVE a values from clacks that has been stored earlier.
INCREMENT a stored value by one. Takes an optional argument to say how much to increment.
DECREMENT a stored value by one. Takes an optional argument to say how much to decrement.
REMOVE/DELETE a stored key from clacks
Get a list of all keys stored in clacks.
Remove all keys stored in clacks.
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.
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).
Get server name and version.
Get the next incoming event in the queue.
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.
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-
This activates a sort of memcached compatibility setup. Don't use this directly, it's an internal wonky workaround. Use Net::Clacks::ClacksCache instead.
This is also part of the internal memcached compatibility setup. Don't use this directly.
Automatically closes the connection.
Please make sure and read the documentations for Net::Clacks as it contains important information pertaining to upgrades and general changes!
Rene Schickbauer, <email@example.com>
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.