lib/corosync/cpg.rb
# Gets a list of members currently in the group
# @return [Corosync::CPG::MemberList]
Gets a list of members currently in the group
Gets a list of members currently in the group
def members
		members = Corosync::CPG::MemberList.new
		cpg_name = Corosync::CpgName.new
		cpg_name[:value] = @group
		cpg_name[:length] = @group.size
		iteration_handle_ptr = FFI::MemoryPointer.new(Corosync.find_type(:cpg_iteration_handle_t))
		Corosync.cs_send(:cpg_iteration_initialize, @handle, Corosync::CPG_ITERATION_ONE_GROUP, cpg_name, iteration_handle_ptr)
		iteration_handle = iteration_handle_ptr.read_uint64
		begin
			iteration_description = Corosync::CpgIterationDescriptionT.new
			begin
				loop do
					Corosync.cs_send(:cpg_iteration_next, iteration_handle, iteration_description)
					members << Corosync::CPG::Member.new(iteration_description)
				end
			rescue Corosync::NoSectionsError
			end
		ensure
			Corosync.cs_send(:cpg_iteration_finalize, iteration_handle)
		end
		members
	end
def members members = Corosync :: CPG :: MemberList . new cpg_name = Corosync :: CpgName . new cpg_name [ :value ] = @group cpg_name [ :length ] = @group . size iteration_handle_ptr = FFI :: MemoryPointer . new ( Corosync . find_type ( :cpg_iteration_handle_t ) ) Corosync . cs_send ( :cpg_iteration_initialize , @handle , Corosync :: CPG_ITERATION_ONE_GROUP , cpg_name , iteration_handle_ptr ) iteration_handle = iteration_handle_ptr . read_uint64 begin iteration_description = Corosync :: CpgIterationDescriptionT . new begin loop do Corosync . cs_send ( :cpg_iteration_next , iteration_handle , iteration_description ) members << Corosync :: CPG :: Member . new ( iteration_description ) end rescue Corosync :: NoSectionsError end ensure Corosync . cs_send ( :cpg_iteration_finalize , iteration_handle ) end members end
Gets a list of members currently in the group
Gets a list of members currently in the group
# signals end of iteration
None
Corosync::CPG::MemberList