Closed doomspork closed 3 years ago
Example usage:
defp events_topic, do: Application.get_env(:assembly, :events_topic) defp bottle_message(resource, atom) do Bottle.Core.V1.Bottle.new( request_id: Bottle.RequestId.write(:http), resource: {atom, resource}, source: "recognizer", timestamp: DateTime.to_unix(DateTime.utc_now()) ) end @decorate span(service: :bullhorn, type: :function) defp send_message(resource, atom) do message = bottle_message(resource, atom) Bottle.publish(events_topic(), message) {:ok, resource} end
We could also pull out the bottle_message/2 function and wrap up some of that for re-use between services.
bottle_message/2
Thoughts @system76/web-engineering?
Bottle.publish(events_topic(), {type, resource}, source: "recognizer", request_id: Bottle.RequestId.write(:http))
Example usage:
We could also pull out the
bottle_message/2
function and wrap up some of that for re-use between services.Thoughts @system76/web-engineering?