mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Use the new unique_integer function to generate IDs
In the eventsource example.
This commit is contained in:
parent
a38735c18e
commit
e923850389
1 changed files with 1 additions and 3 deletions
|
@ -18,6 +18,4 @@ info({message, Msg}, Req, State) ->
|
||||||
{ok, Req, State}.
|
{ok, Req, State}.
|
||||||
|
|
||||||
id() ->
|
id() ->
|
||||||
{Mega, Sec, Micro} = erlang:now(),
|
integer_to_list(erlang:unique_integer([positive, monotonic]), 16).
|
||||||
Id = (Mega * 1000000 + Sec) * 1000000 + Micro,
|
|
||||||
integer_to_list(Id, 16).
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue