Rebus.Service.Call (rebus v0.4.0)
View SourceOne inbound method call, handed to the handler of an exported object.
A handler receives {export_ref, %Rebus.Service.Call{}}, where
export_ref is the reference Rebus.Service.export/4 returned, and answers
it with Rebus.Service.reply/3, Rebus.Service.reply_error/4 or
Rebus.Service.reply_message/3. The struct is what identifies the call to
those functions, so any process holding it can answer.
By the time a call arrives, the connection has checked that its interface
and member are declared on the object and that its arguments have the
declared signature, so body holds values of the declared types.
Fields
conn- the connection the call arrived on.export- the reference of the export the call was routed to.ref- identifies this call to the reply functions.serial- the caller's serial for the call.sender- the caller's unique name, set by the message bus, ornilon a connection created withbus: false.path- the object path called, which under a subtree export can be any path at or below the exported one.interface- the interface the call was routed to. A caller may omit the interface when only one exported interface declares the member; this is then the interface that does. A property access has"org.freedesktop.DBus.Properties"here, and names the interface it targets as the first element ofbody.member- the method name.signature- the signature ofbody, which equals the method's declared in-signature.out_signature- the declared out-signature, whichRebus.Service.reply/3encodes the reply body with: for a property access,"v"forGet,""forSetand"a{sv}"forGetAll.body- the arguments.flags- the message flags.no_reply?- whether the caller asked for no reply. Answering such a call still completes it, but sends nothing.unix_fds-Rebus.UnixFDhandles for the descriptors sent with the call, which itsharguments index. The connection owns them and the handler borrows them until the call completes, when the connection closes them, unlessRebus.Service.take_fds/2has taken them first. The handler cannot close them itself, but a reply may send them back.deadline- theSystem.monotonic_time(:millisecond)at which the connection completes the call itself: it answers the caller withorg.freedesktop.DBus.Error.NoReply, or, for a call that expects no reply, closes the descriptors it carried.nilwhen the call never expires, or expects no reply and carried no descriptors.message- the whole inbound message, for anything not lifted above. Itsunix_fdsare the same borrowed handles.
Summary
Types
@type t() :: %Rebus.Service.Call{ body: [term()], conn: pid(), deadline: integer() | nil, export: reference(), flags: [Rebus.Message.flag()], interface: binary(), member: binary(), message: Rebus.Message.t(), no_reply?: boolean(), out_signature: binary(), path: binary(), ref: reference(), sender: binary() | nil, serial: pos_integer(), signature: binary(), unix_fds: [Rebus.UnixFD.t()] }
An inbound method call awaiting its answer.