zk1931 / jzab

ZooKeeper Atomic Broadcast in Java
http://zk1931.github.io/jzab/master/
Apache License 2.0
54 stars 23 forks source link

Associate a context with request #199

Closed EasonLiao closed 10 years ago

EasonLiao commented 10 years ago

Since all requests issued to Jzab is asynchronous, we need a way to match the completed requests in callback with the one we issued.

Associating a context object with each requests seems to be a good way to solve this, like what ZooKeeper does.

void send(ByteBuffer req, Object ctx);
void flush(ByteBuffer req, Object ctx);
void remove(String serverId, Object ctx);
EasonLiao commented 10 years ago

Probably we don't need clientId in deliver callback anymore?

EasonLiao commented 10 years ago

@m1ch1

EasonLiao commented 10 years ago

@m1ch1

EasonLiao commented 10 years ago

some code refactoring on CommitProcessor