Appspresso
Contact us   |
  • Korean
  • ABOUT
    • Overview
    • License
    • Roadmap
  • SHOWCASE
    • Featured Apps
    • Appspresso Features
    • Show off your app
  • DOWNLOAD
    • Download Appspresso
    • 3rd Party Libraries & Frameworks
  • DEVELOPER CENTER
    • Getting Started
    • FAQ
    • Tutorials
    • API Reference
    • Samples
    • Appspresso PDK
    • Plugin Samples
    • Google Groups

Interface PendingOperation

비동기 호출의 연산에 대응되는 객체입니다.

Interface Summary
Constructor Attributes Constructor Name and Description
 
PendingOperation()

비동기 호출의 연산에 대응되는 객체입니다.

Method Summary

Method Attributes Method Name and Description
 
cancel()

비동기적으로 수행 중인 연산을 취소합니다.

Interface Detail

PendingOperation()

비동기 호출의 연산에 대응되는 객체입니다. 이 인터페이스는 비동기 호출을 취소할 수 있도록 하기 위해 비동기 호출에 의해 반환됩니다.

var pendingOp = null; 
 
// SMS sending example 
var msg = deviceapis.messaging.createMessage(Messaging.MESSAGE_TYPE_SMS); 
msg.body = "I will arrive in 10 minutes"; 
msg.destinationAddress[0] = "+34666666666"; 
 
// Define the success callback 
function messageSent() { 
  alert("The SMS has been sent"); 
  pendingOp = null; 
} 
 
// Define the error callback 
function messageFailed(error) { 
  alert("The SMS could not be sent " + error.message); 
  pendingOp = null; 
} 
 
// To be executed if, for instance, the user presses a cancel button in the user interface 
function cancel() { 
  if (pendingOp != null) { 
    if (pendingOp.cancel()) { 
      alert("The message sending has been canceled"); 
    } else { 
      alert("The operation cannot be canceled"); 
    } 
  } else { 
    alert("The operation cannot be canceled"); 
  } 
} 
 
pendingOp = deviceapis.messaging.send(msg, messageSent, messageFailed);

Method Detail

  • {boolean} cancel()

    비동기적으로 수행 중인 연산을 취소합니다. 이 호출은 실패 없이 항상 성공합니다. 비동기 호출이 취소된 경우는 물론 비동기 호출이 이미 종료되어 취소할 수 없는 경우에도 실패하지 않습니다.

    Returns:
    {boolean}

    비동기 작업이 이미 종료되었거나 기술적 제약으로 비동기 작업을 취소시킬 수 없는 경우 false를 반환합니다. 이 경우 비동기 호출의 결과가 관련된 콜백 함수로 전달되어 호출됩니다. 비동기 작업을 취소시킨 경우 true를 반환합니다. 이 경우 비동기 호출과 관련된 콜백 함수가 호출되지 않습니다.

    API Reference

    • Deviceapis
      • DeviceAPIError
      • Deviceapis
      • ErrorCallback
      • Feature
      • PendingOperation
      • SuccessCallback
    • Devicestatus
      • DeviceStatusManager
      • PropertyChangeSuccessCallback
      • PropertyRef
      • WatchOptions
    • DeviceInteraction
      • DeviceInteractionManager
    • Contact
      • AddContactSuccessCallback
      • Address
      • AddressBook
      • AddressBookArraySuccessCallback
      • Contact
      • ContactAddress
      • ContactArraySuccessCallback
      • ContactFilter
      • ContactManager
      • ContactProperties
      • EmailAddress
      • PhoneNumber
    • Accelerometer
      • Acceleration
      • AccelerationOptions
      • AccelerationSuccessCallback
      • Accelerometer
    • Orientation
      • Orientation
      • OrientationOptions
      • OrientationSuccessCallback
      • Rotation
    • Geolocation
    • Camera
      • Camera
      • CameraArraySuccessCallback
      • CameraCaptureSuccessCallback
      • CameraManager
      • CameraOptions
      • CameraPreviewSuccessCallback
    • Messaging
      • FindMessagesSuccessCallback
      • Message
      • MessageFilter
      • MessageSendCallback
      • Messaging
      • OnIncomingMessage
      • UpdateMessageSuccessCallback
    • Filesystem
      • File
      • FileFilter
      • FileOpenSuccessCallback
      • FileStream
      • FileSystemListSuccessCallback
      • FileSystemManager
      • FileSystemSuccessCallback
      • ReadFileAsStringSuccessCallback
    • Appspresso
      • ax
      • AxDef
      • AxPlugin
      • AxRequest
      • ax.bridge
      • ax.console
      • ax.util
    • Appspresso Extension
      • ax.ext.admob
      • ax.ext.android
      • ax.ext.contact
      • ax.ext.ios
      • ax.ext.ga
      • ax.ext.media
      • ax.ext.net
      • ax.ext.ui
      • ax.ext.zip
    • Plugin (iOS)
    • Plugin (Android)
RSS
Twitter
© 2011 Appspresso.com . powered by Wordpress