-
Notifications
You must be signed in to change notification settings - Fork 280
Implement BSON Marshaler support #142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
||
| func (t *threadSafeSet[T]) UnmarshalJSON(p []byte) error { | ||
| t.RLock() | ||
| t.Lock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.