Skip to content
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

Refactor interaction mutex to be simpler and more consistent #29

Merged
merged 2 commits into from
Nov 16, 2022

Conversation

miketonks-form3
Copy link
Contributor

The interaction struct contains a mix of sync.Map and atomic.Value.

Related to: #28

In preparation for adding another element which also requires locking, for read / write operations, refactor to use a shared sync.RWMutex.

Note planned PR also requires to be able to marshal the interaction object into a JSON response. Replacing these elements with simple golang constructs makes this simpler, avoiding the need to copy into another response struct.

@miketonks-form3 miketonks-form3 requested a review from a team as a code owner November 9, 2022 15:36
@miketonks-form3 miketonks-form3 force-pushed the mike-interaction-mutex branch 2 times, most recently from 775c6d2 to c3029b4 Compare November 9, 2022 16:06
The interaction struct contains a mix of symc.Map and atomic.Value.

In preparation for adding another element which also requires locking,
for read / write operations, refactor to use a shared sync.RWMutex.

Note planned PR also requires to be able to marshal the interaction object
into a JSON response.  Replacing these elements with simple golang constructs
makes this simpler, avoiding the need to copy into another response struct.
@miketonks-form3 miketonks-form3 merged commit 696b8b7 into master Nov 16, 2022
@miketonks-form3 miketonks-form3 deleted the mike-interaction-mutex branch November 16, 2022 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants