• Home
  • Getting Started
  • Documentation
  • API References
  • Downloads
  • Support
Verivo
DevCenter
  • Welcome, Anonymous
  • |
  • Log in
  1. 1.0.1 Documentation
  2. Using the Akula SDKs
  3. Using the Client SDKs
  4. Synchronous and asynchronous requests
Printable version    

Documentation 1.0.1

Related Topics

Page: Synchronous and asynchronous requests
Page: Handling Exceptions and Errors
Page: Configuring the Client Development Environment
Page: Initializing a Connection to the Akula Server
Page: Using the Client SDKs
Page: Remote Data Access from Android and iOS Clients
Page: Using the Akula SDKs
Page: Configuring an iOS Development Environment
Page: Configuring a JavaScript Development Environment
Page: Remote Data Access from JavaScript Clients
Page: Implementing Persistence on Native Clients
  

Labels

  • android
  • ios
  • javascript
  • asynchronous
  • synchronous
  • android_sdk
  • ios_sdk
  • javascript_sdk
  • client_app

Documentation Downloads

  • Installing and Configuring Akula
  • Building Akula Apps
  • Release Notes

All Versions

Latest Official Version (2.5)
Version 3.0 Beta
Version 2.5
Version 2.1
Version 2.0
Version 1.5
Version 1.0.1
Your Rating: Thanks for voting! Please Wait Please Wait Results: PatheticBadOKGoodOutstanding! 2 rates
Initializing a Connection to the Akula Server      Enabling Client-Side Logging
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 "Sync" in the method signature. 

In the iOS client SDK, the synchronous form of a method takes an NSError object as an argument, and the method has the form login:withCredentials:error:. The asynchronous form takes a delegate argument and has the form login:withCredentials:delegate:. For examples using asynchronous and synchronous methods in iOS, see Authenticating Users.

                                               

0 Comments

Hide/Show Comments
You must log in to comment.
 
Initializing a Connection to the Akula Server      Enabling Client-Side Logging
  • Last edited by sgilson@verivo.com on 2013-05-09 20:09:11.0

  • Privacy Policy | Legal Information
    © Copyright 2014, Verivo Software, Inc. All Rights Reserved.