Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: rework mutagen controller, add polling#65

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

deansheather
Copy link
Member

  • Use locks during operations for daemon process consistency
  • Use a state model for UI rendering
  • Use events to signal state changes
  • Fix some tooltip problems that arise from polling

- Use locks during operations for daemon process consistency- Use a state model for UI rendering- Use events to signal state changes- Fix some tooltip problems that arise from polling
_state = state;
// Since the event handlers could block (or call back the
// CredentialManager and deadlock), we run these in a new task.
if (StateChanged == null) return;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't we need to check if the state has actually changed?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I decided not to implement equality for the state type because I would also need to implement equality for the sync session model (and all of it's sub types) which seems like a lot. I don't think there's any side effects of calling this every time it changes though

// Since the event handlers could block (or call back the
// CredentialManager and deadlock), we run these in a new task.
if (StateChanged == null) return;
Task.Run(() => { StateChanged?.Invoke(this, state); });
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are Events threadsafe? If we start this in another task, could it be modified under us in a way that breaks stuff?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I'll copy the EventHandler to a variable before calling it, which I believe makes it thread safe

Copy link
Collaborator

@spikecurtisspikecurtis left a comment

Choose a reason for hiding this comment

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

LGTM

@deansheatherdeansheather merged commit1193e4b intodean/sync-wiringApr 2, 2025
@deansheatherdeansheather deleted the dean/mutagen-controller-rework branchApril 2, 2025 07:03
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@spikecurtisspikecurtisspikecurtis approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@deansheather@spikecurtis

[8]ページ先頭

©2009-2025 Movatter.jp