में एसिंक विधि का कार्यान्वयन मैं पायथन डीबीस में एसिंक विधि कैसे कार्यान्वित करूं? नीचे एक उदाहरण:पायथन डीबीस
class LastfmApi(dbus.service.Object):
def __init__(self):
bus_name = dbus.service.BusName('fm.lastfm.api', bus=dbus.SessionBus())
dbus.service.Object.__init__(self, bus_name, '/')
@dbus.service.method('fm.last.api.account', out_signature="s")
def getUsername(self):
## How do I get this method done asynchronously ??
## For example, this method should go off and retrieve the "username"
## asynchronously. When this method returns, the "username" isn't available
## immediately but will be made available at a later time.
मैं ट्विस्ट के glib2 रिएक्टर का उपयोग कर रहा हूं।
अद्यतन: मुझे पता है इस व्यवहार को लागू करने के लिए संभव है - DBus एक "धारावाहिक" (अद्वितीय पहचानकर्ता) विधि कॉल करने के लिए भी शामिल है और कहा जाता विधि "उत्तर" के साथ "कॉल" मैच के लिए आदेश में इस पहचानकर्ता की पहुंच है ।
यह सब कुछ स्पष्ट नहीं है कि आप यहां क्या हासिल करना चाहते हैं। 'GetUsername' क्या करना है? –