emit_event.py 380 B

12345678910111213141516
  1. """
  2. Task to emit events
  3. """
  4. from uuid import uuid4
  5. from boto_utils import emit_event
  6. from decorators import with_logging
  7. @with_logging
  8. def handler(event, context):
  9. job_id = event["JobId"]
  10. event_name = event["EventName"]
  11. event_data = event["EventData"]
  12. emitter_id = event.get("EmitterId", str(uuid4()))
  13. emit_event(job_id, event_name, event_data, emitter_id)