Ejemplo n.º 1
0
 /// <summary>
 /// return the current locklistener </summary>
 /// <returns> the locklistener </returns>
 public void setLockListener(LockListener lockListener)
 {
     callback.Value = lockListener;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// zookeeper contructor for writelock with callback </summary>
 /// <param name="zookeeper"> the zookeeper client instance </param>
 /// <param name="dir"> the parent path you want to use for locking </param>
 /// <param name="acl"> the acls that you want to use for all the paths </param>
 /// <param name="callback"> the call back instance </param>
 public WriteLock(ZooKeeper zookeeper, string dir, List <ACL> acl, LockListener callback) : this(zookeeper, dir, acl)
 {
     setLockListener(callback);
 }
Ejemplo n.º 3
0
		/// <summary>
		/// zookeeper contructor for writelock with callback
		/// </summary>
		/// <param name="zookeeper"> the zookeeper client instance </param>
		/// <param name="dir">       the parent path you want to use for locking </param>
		/// <param name="acl">       the acls that you want to use for all the paths </param>
		/// <param name="callback">  the call back instance </param>
		public WriteLock(ZooKeeper zookeeper, string dir, IList<ACL> acl, LockListener callback) : this(zookeeper, dir, acl)
		{
			this.callback = callback;
		}
Ejemplo n.º 4
0
 public Lock(string name, string baseUri)
 {
     this.name     = name;
     this.baseUri  = baseUri;
     this.Listener = null;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// return the current locklistener </summary>
 /// <returns> the locklistener </returns>
 public async Task setLockListener(LockListener lockListener)
 {
     using (await lockable.LockAsync()) {
         callback = lockListener;
     }
 }