Class: DBus::Binding::DBusPendingCall
- Inherits:
-
Object
- Object
- DBus::Binding::DBusPendingCall
- Defined in:
- ext/ruby-dbus-pending-call.c,
ext/ruby-dbus-pending-call.c
Overview
A DBusPendingCall is used to retrieve asynchronous replies to method call messages.
See DBusConnection#send_with_reply.
Class Method Summary collapse
-
.new ⇒ self
The new method of this class is not available for invocation.
Instance Method Summary collapse
-
#block ⇒ nil
Blocks until the pending call is completed and a reply is available.
-
#cancel ⇒ nil
Cancels the pending call, any reply or error received will be ignored.
-
#get_completed ⇒ Object
Returns
trueif the pending call has received a reply. -
#get_reply ⇒ Object
Returns the reply DBusMessage, or
nilif no reply has been received yet.
Class Method Details
.new ⇒ self
The new method of this class is not available for invocation.
21 22 23 24 25 26 |
# File 'ext/ruby-dbus-common.c', line 21 VALUE rdbus_private_method(VALUE klass) { rb_raise(rb_eNoMethodError, "Method is unavailable to non-native methods"); return Qnil; } |
Instance Method Details
#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.
96 97 98 99 100 101 |
# File 'ext/ruby-dbus-pending-call.c', line 96 static VALUE cDBusPendingCall_block(VALUE self) { dbus_pending_call_block(CALL_GET(self)); return Qnil; } |
#cancel ⇒ nil
Cancels the pending call, any reply or error received will be ignored.
47 48 49 50 51 52 |
# File 'ext/ruby-dbus-pending-call.c', line 47 static VALUE cDBusPendingCall_cancel(VALUE self) { dbus_pending_call_cancel(CALL_GET(self)); return Qnil; } |
#get_completed ⇒ Object
Returns true if the pending call has received a reply.
60 61 62 63 64 65 66 |
# File 'ext/ruby-dbus-pending-call.c', line 60 static VALUE cDBusPendingCall_get_completed(VALUE self) { if (dbus_pending_call_get_completed(CALL_GET(self))) return Qtrue; return Qfalse; } |
#get_reply ⇒ Object
Returns the reply DBusMessage, or nil if no reply has been received yet.
75 76 77 78 79 80 81 82 83 84 |
# File 'ext/ruby-dbus-pending-call.c', line 75 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; } |