Skip to content

Commit

Permalink
added vtask { } for ScenarioStatsActor to improve performance
Browse files Browse the repository at this point in the history
  • Loading branch information
AntyaDev committed Nov 24, 2022
1 parent 96aa73a commit e4c5922
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 0 additions & 5 deletions src/NBomber/Domain/DomainTypes.fs
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
module internal NBomber.Domain.DomainTypes

open System
open System.Collections.Generic
open System.Threading
open System.Threading.Tasks

open Serilog

open NBomber.Contracts

type SessionId = string
Expand Down
3 changes: 2 additions & 1 deletion src/NBomber/Domain/Stats/ScenarioStatsActor.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ open System.Runtime.CompilerServices
open System.Threading.Channels
open System.Threading.Tasks

open FSharp.Control.Tasks
open FSharp.UMX
open Serilog

Expand Down Expand Up @@ -203,7 +204,7 @@ type ScenarioStatsActor(logger: ILogger,
let mutable _stop = false
let _channel = Channel.CreateUnbounded<ActorMessage>()

let loop () = backgroundTask {
let loop () = vtask {
try
while not _stop do
match! _channel.Reader.ReadAsync() with
Expand Down

0 comments on commit e4c5922

Please sign in to comment.