Package it.ernytech.tdlib

## Class ClientActor

- java.lang.Object
- - it.ernytech.tdlib.ClientActor

    public class ClientActor
    extends java.lang.Object

ClientActor class is an expansion of Client class, which allows you to receive updates via callback

### Constructor Summary

Constructors
`ClientActor​(TdCallback tdCallback)` Creates a ClientActor using the specified callback.
`ClientActor​(TdCallback tdCallback, int timeout)` Creates a ClientActor using the specified callback

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `destroyClientActor()` Destroys the ClientActor and the TDLib instance.
`Response` `execute​(Request request)` Synchronously executes a TDLib request.
`void` `request​(Request request)` Sends one request to TDLib.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ClientActor

    public ClientActor​(TdCallback tdCallback)

Creates a ClientActor using the specified callback.

Parameters:
  `tdCallback` - Callback for outgoing notifications from TDLib.

#### ClientActor

    public ClientActor​(TdCallback tdCallback,
                       int timeout)

Creates a ClientActor using the specified callback

Parameters:
  `tdCallback` - Callback for outgoing notifications from TDLib.
  `timeout` - Maximum number of seconds allowed for this function to wait for new data, when the timeout ends, ClientActor requests a new update list.

### Method Detail

#### request

    public void request​(Request request)

Sends one request to TDLib. The answer will be received via callback.

Parameters:
  `request` - Request to TDLib.

#### execute

    public Response execute​(Request request)

Synchronously executes a TDLib request. Only a few requests can be executed synchronously. May be called from any thread.

Parameters:
  `request` - Request to the TDLib.
Returns:
  The request response.

#### destroyClientActor

    public void destroyClientActor()

Destroys the ClientActor and the TDLib instance.