문제

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