/// <summary> /// return the current locklistener </summary> /// <returns> the locklistener </returns> public void setLockListener(LockListener lockListener) { callback.Value = lockListener; }
/// <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); }
/// <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; }
public Lock(string name, string baseUri) { this.name = name; this.baseUri = baseUri; this.Listener = null; }
/// <summary> /// return the current locklistener </summary> /// <returns> the locklistener </returns> public async Task setLockListener(LockListener lockListener) { using (await lockable.LockAsync()) { callback = lockListener; } }