Skip to content

Comments

Prioritize new tasks over older ones#350

Merged
yacovm merged 2 commits intomainfrom
max-tasks
Feb 17, 2026
Merged

Prioritize new tasks over older ones#350
yacovm merged 2 commits intomainfrom
max-tasks

Conversation

@samliok
Copy link
Collaborator

@samliok samliok commented Feb 17, 2026

No description provided.

sched.go Outdated

// ScheduleOrReplace schedules a task, replacing any queued task if full.
// The cancel function is called before draining the old task.
func (as *BasicScheduler) ScheduleOrReplace(task Task, cancel func()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why not just invoke e.blockBuilderCancelFunc outside, in the epoch?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

because we wont know if we need to cancel it until we grab the lock

Copy link
Collaborator

Choose a reason for hiding this comment

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

But we can cancel it anyway, no?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yea we do, removed

@yacovm yacovm merged commit 57be261 into main Feb 17, 2026
5 checks passed
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