سؤال

There is function which must return a deferred object, but I get a value synchronously.

Now I am returning that value with inlineCallbacks decorator:

@defer.inlineCallbacks
def collect(self, config):
    yield
    data = new_data() # synchronous call
    defer.returnValue(data)

But may be there is some function which wraps value in deferred object, which than is immediately called?

هل كانت مفيدة؟
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top