Przeglądaj źródła

Add emqx_topic:tokens/1 function

Feng Lee 7 lat temu
rodzic
commit
a4550a8fc4
1 zmienionych plików z 5 dodań i 0 usunięć
  1. 5 0
      src/emqx_topic.erl

+ 5 - 0
src/emqx_topic.erl

@@ -157,6 +157,11 @@ levels(Topic) when is_binary(Topic) ->
 tokens(Topic) ->
 tokens(Topic) ->
     binary:split(Topic, <<"/">>, [global]).
     binary:split(Topic, <<"/">>, [global]).
 
 
+%% @doc Split topic to tokens.
+-spec(tokens(topic()) -> list(binary())).
+tokens(Topic) ->
+    binary:split(Topic, <<"/">>, [global]).
+
 %% @doc Split Topic Path to Words
 %% @doc Split Topic Path to Words
 -spec(words(topic()) -> words()).
 -spec(words(topic()) -> words()).
 words(Topic) when is_binary(Topic) ->
 words(Topic) when is_binary(Topic) ->