Observe R3 events on threadpool

This commit is contained in:
Matt Parker
2025-12-05 22:12:26 +10:00
parent 8932667acc
commit f5c24ce0af
4 changed files with 13 additions and 13 deletions

View File

@@ -104,7 +104,7 @@ public partial class CodeEditorPanel : MarginContainer
_tabContainer.SetTabTooltip(newTabIndex, file.Path);
_tabContainer.CurrentTab = newTabIndex;
file.IsDirty.Skip(1).SubscribeOnThreadPool().SubscribeAwait(async (isDirty, ct) =>
file.IsDirty.Skip(1).SubscribeOnThreadPool().ObserveOnThreadPool().SubscribeAwait(async (isDirty, ct) =>
{
//GD.Print($"File dirty state changed: {file.Path} is now {(isDirty ? "dirty" : "clean")}");
await this.InvokeAsync(() =>

View File

@@ -278,7 +278,7 @@ public partial class SharpIdeCodeEdit : CodeEdit
var project = ((IChildSharpIdeNode)_currentFile).GetNearestProjectNode();
if (project is not null)
{
_projectDiagnosticsObserveDisposable = project.Diagnostics.ObserveChanged()
_projectDiagnosticsObserveDisposable = project.Diagnostics.ObserveChanged().SubscribeOnThreadPool().ObserveOnThreadPool()
.SubscribeAwait(async (innerEvent, ct) =>
{
var projectDiagnosticsForFile = project.Diagnostics.Where(s => s.FilePath == _currentFile.Path).ToImmutableArray();