34 lines
611 B
Python
34 lines
611 B
Python
from events.bus import BUS
|
|
from events.types import EVENT_PIPELINE, EVENT_NODE, EVENT_POLICY
|
|
|
|
|
|
async def emit_pipeline(action, state, node):
|
|
|
|
await BUS.emit({
|
|
"type": EVENT_PIPELINE,
|
|
"data": {
|
|
"action": action["name"],
|
|
"state": state,
|
|
"node": node["name"]
|
|
}
|
|
})
|
|
|
|
|
|
async def emit_policy(key, value):
|
|
|
|
await BUS.emit({
|
|
"type": EVENT_POLICY,
|
|
"data": {
|
|
"key": key,
|
|
"value": value
|
|
}
|
|
})
|
|
|
|
|
|
async def emit_node(node):
|
|
|
|
await BUS.emit({
|
|
"type": EVENT_NODE,
|
|
"data": node
|
|
})
|