| 12345678910111213141516171819202122 |
- using Quadarax.Application.QLiberace.Common.Executor;
- using Quadarax.Foundation.Core.Logging;
- namespace Quadarax.Application.QLiberace.Processor.Executor
- {
- public class DummyExecutor : BaseParametricExecutor
- {
- private static Random _rnd = new Random();
-
- public DummyExecutor(TimeSpan defaultTimeout, IQLogger? logger = null) : base(defaultTimeout, logger)
- {
- }
- protected override bool OnExecute(Guid iid)
- {
- var result = DummyExecutor._rnd.Next(100) >= 50;
- var throwError = DummyExecutor._rnd.Next(100) >= 50;
- if (throwError) throw new InvalidOperationException("Dummy random exception throw.");
- return result;
- }
- }
- }
|