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

Add graph.UpdateVertex func #185

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mdgreenfield
Copy link

@mdgreenfield mdgreenfield commented Jan 14, 2025

This PR is a fix for #173

With this PR a Vertex can be replaced allowing callers to first retrieve an existing Vertex, make all updates, and then call the new function graph.UpdateVertex with the old hash and the new vertex.

Note: The way the vertex is updated is inefficient and not thread safe. I think a good approach to fix this would be to actually create a non-exported vertex node with a data field that takes the T type and then UpdateVertex could swap the data field. I think this could be introduced without any breaking changes to the API.

@mdgreenfield mdgreenfield marked this pull request as draft January 16, 2025 17:29
This PR is a fix for dominikbraun#173

With this PR a Vertex can be replaced allowing callers to first retrieve
an existing Vertex, make all updates, and then call the new function
`graph.UpdateVertex` with the old hash and the new vertex.
@mdgreenfield mdgreenfield marked this pull request as ready for review January 16, 2025 23:12
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.

1 participant