forked from platypush/platypush
get_bus() should return a default RedisBus() instance if the main bus is not registered
This commit is contained in:
parent
b1491b8048
commit
f7c594cc3f
1 changed files with 5 additions and 2 deletions
|
@ -133,8 +133,11 @@ def get_plugin(plugin_name, reload=False):
|
||||||
|
|
||||||
def get_bus() -> Bus:
|
def get_bus() -> Bus:
|
||||||
global main_bus
|
global main_bus
|
||||||
assert main_bus, 'The bus is not registered'
|
if main_bus:
|
||||||
return main_bus
|
return main_bus
|
||||||
|
|
||||||
|
from platypush.bus.redis import RedisBus
|
||||||
|
return RedisBus()
|
||||||
|
|
||||||
|
|
||||||
def get_or_create_event_loop():
|
def get_or_create_event_loop():
|
||||||
|
|
Loading…
Reference in a new issue