Class DBus::Binding::DBusPendingCall
In: ruby-dbus.c
Parent: Object

A DBusPendingCall is used to retrieve asynchronous replies to method call messages.

See DBusConnection#send_with_reply.

Methods

block   cancel   get_completed   get_reply   new  

Public Class methods

The new method of this class is not available for invocation.

[Source]

/*
 *  call-seq:
 *      new => self
 *  
 *  The new method of this class is not available for invocation.
 */
VALUE
rdbus_private_method(VALUE klass)
{
  rb_raise(rb_eNoMethodError, "Method is unavailable to non-native methods");
  return Qnil;
}

Public Instance methods

Blocks until the pending call is completed and a reply is available.

The blocking behaviour is the same as that for DBusConnection#send_with_reply_and_block.

[Source]

/*
 *  call-seq:
 *      block => nil
 *
 *  Blocks until the pending call is completed and a reply is
 *  available.
 *
 *  The blocking behaviour is the same as that for
 *  DBusConnection#send_with_reply_and_block.
 */
static VALUE
cDBusPendingCall_block(VALUE self)
{
  dbus_pending_call_block(CALL_GET(self));
  return Qnil;
}

Cancels the pending call, any reply or error received will be ignored.

[Source]

/*
 *  call-seq:
 *      cancel => nil
 *
 *  Cancels the pending call, any reply or error received will be
 *  ignored.
 */
static VALUE
cDBusPendingCall_cancel(VALUE self)
{
  dbus_pending_call_cancel(CALL_GET(self));
  return Qnil;
}

Returns true if the pending call has received a reply.

[Source]

/*
 *  call-seq:
 *      get_completed => true|false
 *
 *  Returns +true+ if the pending call has received a reply.
 */
static VALUE
cDBusPendingCall_get_completed(VALUE self)
{
  if (dbus_pending_call_get_completed(CALL_GET(self)))
    return Qtrue;
  return Qfalse;
}

Returns the reply DBusMessage, or nil if no reply has been received yet.

[Source]

/*
 *  call-seq:
 *      get_reply => message
 *
 *  Returns the reply DBusMessage, or +nil+ if no reply
 *  has been received yet.
 */
static VALUE
cDBusPendingCall_get_reply(VALUE self)
{
  DBusMessage *msg = NULL;

  msg = dbus_pending_call_get_reply(CALL_GET(self));
  if (msg != NULL)
    return MSG_NEW(msg);
  return Qnil;
}

[Validate]