- }),
- Error
- end.
- mk_client_opts(Name, WorkerId, Ingress, ClientOpts = #{clientid := ClientId}) ->
- ClientOpts#{
- clientid := mk_clientid(WorkerId, ClientId),
- msg_handler => mk_client_event_handler(Name, Ingress)
- }.
- mk_clientid(WorkerId, ClientId) ->
- iolist_to_binary([ClientId, $: | integer_to_list(WorkerId)]).
- mk_client_event_handler(Name, Ingress = #{}) ->
- IngressVars = maps:with([server], Ingress),
- OnMessage = maps:get(on_message_received, Ingress, undefined),
- LocalPublish =
- case Ingress of
- #{local := Local = #{topic := _}} ->
- Local;
- #{} ->