Documentation 1.0.1
Related Topics

Labels
Documentation Downloads
All Versions
Documentation Version 1.0.1
NOTE: You are currently viewing version 1.0.1 of the Akula documentation.
View the latest version of this page or go to the current documentation home page. |
Synchronous and asynchronous requests
The Akula Server supports both synchronous and asynchronous requests for all clients except JavaScript. The JavaScript client only supports asynchronous requests. A best practice is to use asynchronous requests because the app can continue executing after an asynchronous request. Synchronous requests should only be used when you want to manage your own threads.
An asynchronous request uses callback methods, where the app invokes a callback method when the Akula Server responds to the request. The callback methods can handle a successful request and a request failure, as the following example shows for a log in:
A synchronous request waits for the Akula Server to return a response before the app continues. Typically, you make a synchronous request in a try/catch block, as the following example shows:
If the loginSync()
method fails, it throws a AKException object that you can catch and handle appropriately for your app.
![]() | Note that in the Android client SDK, the synchronous form of a method contains " In the iOS client SDK, the synchronous form of a method takes an NSError object as an argument, and the method has the form |
0 Comments
Hide/Show Comments