Skip to content

Correctly track session elements in dynamic build plan#2104

Open
abderrahim wants to merge 1 commit intomasterfrom
abderrahim/dynamic-session-elements
Open

Correctly track session elements in dynamic build plan#2104
abderrahim wants to merge 1 commit intomasterfrom
abderrahim/dynamic-session-elements

Conversation

@abderrahim
Copy link
Contributor

When using a dynamic build plan, all elements are passed to the queue to be enqueued, but are only actually enqueued when they become required.

This moves the tracking of session elements to the first queue rather than just take everything that we pass to the queue (which would be all elements).

This is only used in the UI AFAICT, and doesn't actually affect the build.

When using a dynamic build plan, all elements are passed to the queue to be
enqueued, but are only actually enqueued when they become required.

This moves the tracking of session elements to the first queue rather than just
take everything that we pass to the queue (which would be all elements).

This is only used in the UI AFAICT, and doesn't actually affect the build.
def _enqueue_plan(self, plan, *, queue=None):
queue = queue or self.queues[0]
queue.enqueue(plan)
self.session_elements += plan
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The frontend still uses Stream.session_elements, which is now always empty.

I don't see how this branch can work as it is, but I could be missing something.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We pass the list to the queue a bit earlier

            queue.set_session_elements(self.session_elements)

which then fills it as elements are getting enqueued.

Yeah, it's a bit confusing but I couldn't find a better way to do it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the alternative is to make Element support more than one callback when it becomes required? This way both the Stream and the Queue can pass their own callbacks?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, it's just a reference to the list created in Stream. I think set_session_elements() threw me off as that doesn't actually set any elements, it just passes a reference to the list. With clearer naming and/or comment, it might be ok.

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