From 3b891e9e8d327b205cefd83d4b06828f40d55204 Mon Sep 17 00:00:00 2001 From: karashiiro <49822414+karashiiro@users.noreply.github.com> Date: Mon, 20 Feb 2023 09:16:33 -0800 Subject: [PATCH] feat: Run network callbacks on the ThreadPool --- Dalamud/Game/Network/Internal/NetworkHandlers.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Dalamud/Game/Network/Internal/NetworkHandlers.cs b/Dalamud/Game/Network/Internal/NetworkHandlers.cs index ef8090d1c..de323f0ba 100644 --- a/Dalamud/Game/Network/Internal/NetworkHandlers.cs +++ b/Dalamud/Game/Network/Internal/NetworkHandlers.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; +using System.Reactive.Concurrency; using System.Reactive.Linq; using System.Runtime.InteropServices; using System.Threading.Tasks; @@ -269,6 +270,7 @@ internal class NetworkHandlers : IDisposable, IServiceType .And(this.OnMarketBoardListingsBatch(startObservable)) .Then((request, sales, listings) => (request, sales, listings))) .Where(this.ShouldUpload) + .SubscribeOn(ThreadPoolScheduler.Instance) .Subscribe( data => { @@ -314,6 +316,7 @@ internal class NetworkHandlers : IDisposable, IServiceType { return this.OnMarketTaxRates() .Where(this.ShouldUpload) + .SubscribeOn(ThreadPoolScheduler.Instance) .Subscribe( taxes => { @@ -340,6 +343,7 @@ internal class NetworkHandlers : IDisposable, IServiceType return this.OnMarketBoardPurchaseHandler() .Zip(this.OnMarketBoardPurchase()) .Where(this.ShouldUpload) + .SubscribeOn(ThreadPoolScheduler.Instance) .Subscribe( data => { @@ -370,6 +374,7 @@ internal class NetworkHandlers : IDisposable, IServiceType private unsafe IDisposable HandleCfPop() { return this.OnCfNotifyPop() + .SubscribeOn(ThreadPoolScheduler.Instance) .Subscribe( message => {