Skip to content

Commit

Permalink
NCBC-395: Assign each client instance an identifer
Browse files Browse the repository at this point in the history
Change-Id: Ib20248cb80a0a88e6de8c87c54f5176e85449f63
Reviewed-on: http://review.couchbase.org/33691
Tested-by: Jeffry Morris <jeffrymorris@gmail.com>
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
  • Loading branch information
jeffrymorris committed Feb 18, 2014
1 parent 39f7381 commit 89ef331
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Enyim.Caching/IMemcachedClient.cs
Expand Up @@ -57,5 +57,6 @@ public interface IMemcachedClient : IDisposable
ServerStats Stats(string type);

event Action<IMemcachedNode> NodeFailed;
Guid Identity { get; }
}
}
8 changes: 7 additions & 1 deletion src/Enyim.Caching/MemcachedClient.cs
Expand Up @@ -88,6 +88,9 @@ public MemcachedClient(IServerPool pool, IMemcachedKeyTransformer keyTransformer
if (keyTransformer == null) throw new ArgumentNullException("keyTransformer");
if (transcoder == null) throw new ArgumentNullException("transcoder");

Identity = Guid.NewGuid();
log.WarnFormat("Creating new client. CID: {0} {1}", Identity, GetType().Name);

this.performanceMonitor = performanceMonitor;
this.keyTransformer = keyTransformer;
this.transcoder = transcoder;
Expand Down Expand Up @@ -1082,7 +1085,10 @@ public void Dispose()
}

#endregion
}


public Guid Identity { get; protected set; }
}
}

#region [ License information ]
Expand Down

0 comments on commit 89ef331

Please sign in to comment.