Skip to content
Perl bindings for multicast messaging via corosync's libcpg
Perl Shell
Latest commit 8961d4b Apr 3, 2012 @cventers Fix memory leak in membership arrays created during confchg callbacks
When we created membership arrays in confchg callbacks, we left an extra
reference lying around.

Thanks to David Coles for this fix.

Signed-off-by: Chase Venters <>


    Corosync::CPG - Perl bindings for Corosync virtual synchrony / libcpg

      use Corosync::CPG qw/:constants/;

      # Connect to Corosync executive
      my $cpg = Corosync::CPG->new(
          callbacks => {
              deliver => \&deliver_callback,
              confchg => \&confchg_callback,

      # Join a CPG multicast group

      # Send a CPG message
      $cpg->mcast_joined(CPG_TYPE_AGREED, "the current time is " . time);

      # Non-blocking check for pending messages

      # Process pending messages forever

    Corosync::CPG is a module to enable Perl access to the Corosync CPG
    service, courtesy of the system's Corosync executive. CPG enables
    distributed applications that operate properly during cluster
    partitions, merges and faults. CPG provides reliable, predictably
    ordered multicast messaging, and you get notified any time the cluster
    group gains or loses nodes.

DEPENDENCIES - Corosync CPG client library
        This is the library that talks to the Corosync executive.

    Running Corosync executive / CPG service
        All CPG logic is actually implemented as the CPG service running on
        the Corosync executive. Without it, no CPG service is possible.

    Access to Corosync executive
        Accesing the Corosync executive may require your program to be
        running as the same username as the executive. Check the Corosync
        documentation for more details.

    Chase Venters <>

    Copyright (c) 2010 Chase Venters. All rights reserved. This program is
    free software; you can redistribute it and/or modify it under the same
    terms as Perl itself.


Something went wrong with that request. Please try again.