-
Notifications
You must be signed in to change notification settings - Fork 1
Description
This issue demands a new descriptor type ObjectDescriptor and LockDescriptor over the old SimpleDescriptor.
SimpleDescriptor has both the ID of the object to be acquired and the Owner that needs to acquire it. While this makes sense for having complete details about the lock being acquired and that needs to be maintained in the map, this doesn't make sense when the lock is being pounced on. The lock that has to be pounced on cannot be described by a SimpleDescriptor but needs just the description of the object.
Thus, on separating these concerns I propose the following:
SimpleDescriptorgets a more meaningful name -LockDescriptorand has all data fields the same.- A new descriptor
ObjectDescriptorthat has only theIDof the object in it.
This suffices the needs of the pouncing feature.
Edit: The main reason for the move is the pouncers map in the lock client that needs to map the ObjectDescriptors to the slice of the pouncers and not a SimpleDescriptor to the slice of owners. The move is proposed so that in the future we can easily add fields to the struct of ObjectDescriptor and have our code function.
Edit 2: This also means that now, Watch can also take in ObjectDescriptor as it's argument instead of the SimpleDescriptor.