Skip to content

Commit da5856b

Browse files
authored
Merge pull request #1 from ccheetham/fix/memleak
feat: use time span for replay buffer
2 parents 179b516 + 2502eb3 commit da5856b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/JsonRpc/ProcessScheduler.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ IScheduler scheduler
3434

3535
var observableQueue =
3636
new BehaviorSubject<(RequestProcessType type, ReplaySubject<IObservable<Unit>> observer, Subject<Unit>? contentModifiedSource)>(
37-
( RequestProcessType.Serial, new ReplaySubject<IObservable<Unit>>(10, Scheduler.Immediate), supportContentModified ? new Subject<Unit>() : null )
37+
( RequestProcessType.Serial, new ReplaySubject<IObservable<Unit>>(TimeSpan.FromSeconds(6), Scheduler.Immediate), supportContentModified ? new Subject<Unit>() : null )
3838
);
3939

4040
cd.Add(
@@ -52,7 +52,7 @@ IScheduler scheduler
5252

5353
logger.LogDebug("Completing existing request process type {Type}", observableQueue.Value.type);
5454
observableQueue.Value.observer.OnCompleted();
55-
observableQueue.OnNext(( item.type, new ReplaySubject<IObservable<Unit>>(10, Scheduler.Immediate), supportContentModified ? new Subject<Unit>() : null ));
55+
observableQueue.OnNext(( item.type, new ReplaySubject<IObservable<Unit>>(TimeSpan.FromSeconds(6), Scheduler.Immediate), supportContentModified ? new Subject<Unit>() : null ));
5656
}
5757

5858
logger.LogDebug("Queueing {Type}:{Name} request for processing", item.type, item.name);

0 commit comments

Comments
 (0)