예제 #1
0
        /// <summary>
        /// Construct new group object
        /// </summary>
        /// <param name="name">name of the new group</param>
        /// <param name="container">container of groups</param>
        /// <returns></returns>
        public static ZreGroup NewGroup(string name, Dictionary <string, ZreGroup> container)
        {
            var group = new ZreGroup(name);

            container[name] = group;
            return(group);
        }
예제 #2
0
 /// <summary>
 /// Find or create group via its name
 /// </summary>
 /// <param name="groupName"></param>
 /// <returns></returns>
 public ZreGroup RequirePeerGroup(string groupName)
 {
     ZreGroup group;
     if (!_peerGroups.TryGetValue(groupName, out group))
     {
         group = new ZreGroup(groupName);
     }
     return group;
 }
예제 #3
0
 /// <summary>
 /// Remove peer from group, if it's a member
 /// </summary>
 /// <param name="group"></param>
 /// <param name="peer"></param>
 public void DeletePeer(ZreGroup group, ZrePeer peer)
 {
     group.Leave(peer);
 }
예제 #4
0
파일: ZreGroup.cs 프로젝트: vadian/netmq
 /// <summary>
 /// Construct new group object
 /// </summary>
 /// <param name="name">name of the new group</param>
 /// <param name="container">container of groups</param>
 /// <returns></returns>
 public static ZreGroup NewGroup(string name, Dictionary<string, ZreGroup> container)
 {
     var group = new ZreGroup(name);
     container[name] = group;
     return group;
 }