mirror of
https://github.com/evennia/evennia.git
synced 2026-04-02 14:07:16 +02:00
Added cmd.funcpart as a way of adding multiple-part commands, each with a possibility to yield with a deferred. This allows for flexible implementation of delayed commands and other asynchronous goodies.
This commit is contained in:
parent
47356ca632
commit
0121f36ac0
2 changed files with 9 additions and 4 deletions
|
|
@ -496,7 +496,7 @@ def uses_database(name="sqlite3"):
|
|||
engine = settings.DATABASE_ENGINE
|
||||
return engine == "django.db.backends.%s" % name
|
||||
|
||||
def delay(to_return, delay=2, callback=None):
|
||||
def delay(delay=2, retval=None, callback=None):
|
||||
"""
|
||||
Delay the return of a value.
|
||||
Inputs:
|
||||
|
|
@ -508,7 +508,7 @@ def delay(to_return, delay=2, callback=None):
|
|||
"""
|
||||
d = defer.Deferred()
|
||||
callb = callback or d.callback
|
||||
reactor.callLater(delay, callb, to_return)
|
||||
reactor.callLater(delay, callb, retval)
|
||||
return d
|
||||
|
||||
_FROM_MODEL_MAP = None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue