Remove ability to change update handler after client creation.

GitOrigin-RevId: 917737a440afaeb99f8a8ca809cda2d267bb4b02
This commit is contained in:
levlam 2020-10-05 20:18:59 +03:00
parent 5f605d2dd2
commit da55a34afc
2 changed files with 0 additions and 30 deletions

View File

@ -103,28 +103,6 @@ public final class Client implements Runnable {
return nativeClientExecute(query);
}
/**
* Replaces handler for incoming updates from the TDLib.
*
* @param updateHandler Handler with onResult method which will be called for every incoming
* update from the TDLib.
* @param exceptionHandler Exception handler with onException method which will be called on
* exception thrown from updateHandler, if it is null, defaultExceptionHandler will be invoked.
*/
public void setUpdateHandler(ResultHandler updateHandler, ExceptionHandler exceptionHandler) {
updateHandlers.put(nativeClientId, new Handler(updateHandler, exceptionHandler));
}
/**
* Replaces handler for incoming updates from the TDLib. Sets empty ExceptionHandler.
*
* @param updateHandler Handler with onResult method which will be called for every incoming
* update from the TDLib.
*/
public void setUpdateHandler(ResultHandler updateHandler) {
setUpdateHandler(updateHandler, null);
}
/**
* Replaces default exception handler to be invoked on exceptions thrown from updateHandler and all other ResultHandler.
*

View File

@ -76,14 +76,6 @@ public:
return Api::FromUnmanaged(*td::Client::execute(std::move(request)).object);
}
/// <summary>
/// Replaces handler for incoming updates from the TDLib.
/// </summary>
/// <param name="updateHandler">Handler with OnResult method which will be called for every incoming update from the TDLib.</param>
void SetUpdateHandler(ClientResultHandler^ updateHandler) {
handlers[0] = updateHandler;
}
/// <summary>
/// Launches a cycle which will fetch all results of queries to TDLib and incoming updates from TDLib.
/// Must be called once on a separate dedicated thread, on which all updates and query results will be handled.