Implement BSON Marshaler support#142
Conversation
|
|
||
| func (t *threadSafeSet[T]) UnmarshalJSON(p []byte) error { | ||
| t.RLock() | ||
| t.Lock() |
There was a problem hiding this comment.
UnmarshalJSON should be a write lock - unlikely to cause issues in practice (with a newly-initialized Set), but an inconsistency nonetheless.
|
Hi @ryclarke, Thanks for the contribution and nice catch on the locking issue for UnmarshalJSON. I want to make you aware of this issue if you're not already: #122 See the issue to get more context but I have no problem in general adding support for BSON. |
|
Thanks for the heads up - time permitting I may be able to help implement a fix for that bug in a separate PR |
82746cc to
fff59c0
Compare
df0c692 to
55fd0b8
Compare
55fd0b8 to
415c040
Compare
|
@ryclarke - is this ready for review? Just saw another push come through. |
Yes, this is ready to go now (last change was just a minor version bump in the BSON library) |
|
Nice work, iv’e merged it, and will also be looking at a few other PRs and will be tagging a new release sometime this evening. |
|
Excellent! 😄 |
Adds implementation of bson.Marshaler interface to Sets.
Also addresses a locking inconsistency in UnmarshalJSON.
BSON support is important for our use cases, and should be a good improvement to this library's capabilities.