NAME
IPC::Manager::Base::FS - Base class for filesystem based protocols
DESCRIPTION
This is the base class for filesystem based message stores and protocols.
METHODS
See IPC::Manager::Client for inherited methods
FS SPECIFIC
- $bool = $con->check_path($path)
-
Check if a path is a valid client path, what that means is protocol specific.
- $con->clear_pid
-
Remove the pid from the pidfile, marking the client inactive.
- $bool = $con->have_resume_file
-
Check if we have a resume file. A resume file is where re-queued messages go.
- $con->make_path($path)
-
Create the path for the client. What this means is protocol specific.
- $path = $con->path
-
Get the proper path for the client.
- $string = $con->path_type
-
Returns a human readable name for what types of files/etc the paths should be.
- $on_disk = $con->on_disk_name($peer_id)
-
Returns the filesystem component used for
$peer_idunder the route directory. For short, safe names the peer id is returned unchanged. For names that would exceed "max_on_disk_name_length", contain path-unsafe characters, or begin with the reservedh-prefix, returns"h-" . substr(sha256_hex($peer_id), 0, 40). The mapping from hashed on-disk name back to the real peer id is recorded in a.namesidecar file so that "peers" and "all_stats" report real peer names. This lets callers use arbitrarily long peer ids transparently. - $n = $con->max_on_disk_name_length
-
Returns the maximum length of an on-disk peer name component before it is hashed. Defaults to 200, which is safe on common filesystems. Subclasses may override this. In particular IPC::Manager::Client::UnixSocket computes it dynamically from the route length to stay within the
sun_pathlimit. - $file = $con->name_file($peer_id)
-
Returns the path to the
.namesidecar file for$peer_id. Defaults to$self->{+ID}when$peer_idis not given. - $file = $con->peer_pid_file($peer_name)
-
Get the path to the pidfile for the peer of the given name.
- $file = $con->pidfile
-
Get the pidfile for the connection.
- @messages = $con->read_resume_file
-
Get any messages from the resume file, then delete the file.
- $file = $con->resume_file
-
Get the resume file for the connection.
- $file = $con->stats_file
-
Get the stats file for the connection.
- $con->write_pid
-
Write the pidfile for the connection.
- $bool = $con->can_select
-
Returns true if
IO::Selectis available and this client can use it for non-blocking message detection. - $select = $con->select
-
Returns a cached IO::Select object populated with the client's
handles_for_select. Creates the object on first call. Returns undef ifcan_selectis false or there are no handles to monitor. - $bool = $con->have_handles_for_peer_change
-
Returns true if Linux::Inotify2 is available and can be used to watch the route directory for new peer connections.
- $con->reset_handles_for_peer_change
-
Drains pending inotify events after a peer-change notification so that the handle does not remain spuriously readable.
- @handles = $con->handles_for_peer_change
-
Returns the inotify filehandle watching the route directory for peer arrivals and departures. Dies unless Linux::Inotify2 is available.
SOURCE
The source code repository for IPC::Manager can be found at https://github.com/exodist/IPC-Manager.
MAINTAINERS
AUTHORS
COPYRIGHT
Copyright Chad Granum <exodist7@gmail.com>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.