Open GoogleCodeExporter opened 9 years ago
I had a quick look at this. The UID includes the time, and the smallest
resolution is microseconds. Apparently that is not fast enough. There are a few
possible paths:
- base the UID on something else, but a finer time resolution could probably
hit the same problem
- update documentation to note the microsecond issue ... if the calling code
needs multiple UIDs "at once", then it could get one and add its own suffixes
to create the others
- add a counter in the generate_UID code as suggested in the submitted issue.
There is already code, though, to optionally truncate if the UID becomes too
long, and I'm not sure if that limit might be hit.
- additionally, could add an optional argument to return a specific number of
UIDs as a tuple. Then the code could simply increment the microseconds on the
first one (not increasing the length)... and store the last one to ensure that
subsequent calls started later than that
Anyone have ideas on these or other options?
Original comment by darcymason@gmail.com
on 5 Apr 2013 at 12:53
Original issue reported on code.google.com by
jog...@gmail.com
on 2 Apr 2013 at 1:25