【文章內(nèi)容簡介】
Lock(2) ? When client lose connection with server, ephemeral file is deleted, including those indicate locks, thus locks is released. ? To prevent ambiguity, user file is not allowed?to?end?with?“~”,?so?they?are?easy?to be differentiated from files used to implement locks. Events ? EventType – EventCreated – EventRemoved – EventChanged – EventLockChanged – EventArbitrary ? All event would apply on both directories and files Events(2) ? All callbacks are managed by client, when a callback is first registered on a event, the client registers the event on master. ? When a client receives a event, it invoke all callbacks registered on the event. ? User could cancel all callbacks on a certain path, and client would unregister events on server. Event(3) ? Client supply a Callback class to implement use callback, it contains a pure virtual function run(). ? User implement their own class based on Callback, and implement the run() function. User could save any necessary information in the class. ? When client invoke a Callback, it create a thread to invoke the run() function. Choose Server ? There a 5 se