WIP: Generalize sequence incrementing and only increment sequences when time doesn't move forwards #136

Closed
radix wants to merge 4 commits from 106-sequence-incr into master
radix commented 2018-02-05 17:05:45 -06:00 (Migrated from github.com)

This is a big backwards-incompatible change, and WORK-IN-PROGRESS.

  • UuidV1Context was renamed to DefaultUuidV1Context
  • a new trait called UuidV1Context is added. This trait has a method for getting a u16 sequence number given the current time.
  • DefaultUuidV1Context now has a Mutex in it for storing and updating the last time that a sequence number was requested. This means that DefaultUuidV1Context is only available when the std feature is enabled.

Is there any way we can avoid the context? I'm sure it probably slows down new_v1 a lot (though I plan on adding some benchmarks for this).

Also, while #106 proposed changing UuidV1Context to a trait, I think this might be unnecessary churn. A trait is a good idea, but it should probably be called something else so that UuidV1Context can remain backwards compatible.

This is a big backwards-incompatible change, and WORK-IN-PROGRESS. * `UuidV1Context` was renamed to `DefaultUuidV1Context` * a new trait called `UuidV1Context` is added. This trait has a method for getting a u16 sequence number given the current time. * `DefaultUuidV1Context` now has a Mutex in it for storing and updating the last time that a sequence number was requested. This means that `DefaultUuidV1Context` is only available when the `std` feature is enabled. Is there any way we can avoid the context? I'm sure it probably slows down new_v1 a lot (though I plan on adding some benchmarks for this). Also, while #106 proposed changing `UuidV1Context` to a trait, I think this might be unnecessary churn. A trait is a good idea, but it should probably be called something else so that `UuidV1Context` can remain backwards compatible.
KodrAus (Migrated from github.com) reviewed 2018-02-05 17:05:45 -06:00
Dylan-DPC-zz (Migrated from github.com) reviewed 2018-02-05 17:05:45 -06:00
kinggoesgaming (Migrated from github.com) reviewed 2018-02-05 17:05:45 -06:00
kinggoesgaming commented 2018-02-05 18:03:45 -06:00 (Migrated from github.com)

This means that DefaultUuidV1Context is only available when the std feature is enabled.

I think we need to think this one through a little more, there should be an option available when a user is in no_std mode.

> This means that DefaultUuidV1Context is only available when the std feature is enabled. I think we need to think this one through a little more, there should be an option available when a user is in `no_std` mode.
radix commented 2018-02-05 18:05:54 -06:00 (Migrated from github.com)

@kinggoesgaming I have some other discussion points back on the ticket at #106.

@kinggoesgaming I have some other discussion points back on the ticket at #106.
kinggoesgaming commented 2018-02-08 13:51:55 -06:00 (Migrated from github.com)

superseded by #137

superseded by #137

Pull request closed

Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-uuid-rs/uuid!136
No description provided.