29
loading...
This website collects cookies to deliver better user experience
SyncWorker<TRequest, TResult>
abstract base class.Start(TRequest)
GetWorkStatus()
Completed
or Faulted
will then allow for the return of data from one of the following two methods, depending no which status the grain is in.GetResult()
Completed
state, in the form of TResult
.GetException()
Faulted
state.ISyncWorker<TRequest, TResult>
and provides implementation details for the methods describe from the previously mentioned interface, as well as a few other methods:CreateTask(TRequest request)
Start(TRequest request)
method, which sets the _task
state on the instance, and enqueues that long running work onto a LimitedConcurrencyLevelTaskScheduler
PerformWork(TRequest request)
_task
, and is the “thing” that needs to be implemented within the implementations of this class.SyncWorker<TRequest, TResult>
within the Orleans.SyncWork.Tests project.Parallel.For
, and the parallel execution offered through the SyncWork<TRequest, TResponse>
implementation. The latter can be slower then Parallel.For
, but faster then the serial execution - though keep in mind this benchmarking testing is done completely locally, where in a real world scenario, you’d be bringing up multiple silo hosts to make up a highly available cluster. At this point it stands to reason that the functionality exposed by this package will far exceed the performance accomplished with a single machine.Method | Mean | Error | StdDev |
---|---|---|---|
Serial | 12.284 s | 0.0145 s | 0.0135 s |
MultipleTasks | 12.274 s | 0.0073 s | 0.0065 s |
MultipleParallelTasks | 1.723 s | 0.0185 s | 0.0144 s |
OrleansTasks | 1.118 s | 0.0080 s | 0.0074 s |
SyncWork
base class correctly.