route
This commit is contained in:
parent
89a978a67a
commit
8f22b0ffbc
|
@ -224,8 +224,11 @@ publish(Msg = #mqtt_message{from = From}) ->
|
|||
end.
|
||||
|
||||
publish(Topic, Msg) when is_binary(Topic) ->
|
||||
lists:foreach(fun(#mqtt_topic{topic=Name, node=Node}) ->
|
||||
rpc:cast(Node, ?ROUTER, route, [Name, Msg])
|
||||
lists:foreach(fun(#mqtt_topic{topic = Name, node = Node}) ->
|
||||
case Node =:= node() of
|
||||
true -> ?ROUTER:route(Name, Msg);
|
||||
false -> rpc:cast(Node, ?ROUTER, route, [Name, Msg])
|
||||
end
|
||||
end, match(Topic)).
|
||||
|
||||
%%------------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue