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

Multi-step content linking #411

Open
kpreid opened this issue Oct 6, 2023 · 1 comment
Open

Multi-step content linking #411

kpreid opened this issue Oct 6, 2023 · 1 comment
Labels
area: data Things related to the data structures underlying the world, and the functions that manipulate them. kind: feature Adding user-facing/developer-facing functionality

Comments

@kpreid
Copy link
Owner

kpreid commented Oct 6, 2023

Currently, BlockProvider::new() runs a function to create each block. However, some blocks (and other entities in the future) want to refer to each other, and there's no way to do that than awkwardly jumping into explicit mutation. Additionally, in the future, other linking might want more complex interconnections.

My current thinking for how to solve this problem is to split the work into two steps:

  1. Run step-1 functions to create each universe member, with a possibly-placeholder value.
  2. For each member that needs it, run a step-2 function to execute a transaction on it to make connections, while giving it &URef access to other members.
@kpreid kpreid added the kind: feature Adding user-facing/developer-facing functionality label Oct 6, 2023
@kpreid kpreid added the area: data Things related to the data structures underlying the world, and the functions that manipulate them. label Dec 20, 2023
@kpreid
Copy link
Owner Author

kpreid commented Sep 12, 2024

Another possibility would be to create Handles that do not hold values (like we already do for deserialization) so that it is possible to make the connections in only one pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: data Things related to the data structures underlying the world, and the functions that manipulate them. kind: feature Adding user-facing/developer-facing functionality
Projects
None yet
Development

No branches or pull requests

1 participant