Skip to content

Commit 5cec045

Browse files
[API] Default implementation for IWorker.UseBackgroundThread. (#61)
Add a default property implementation for the propery so that users do not have to constantly implement it. This allow developers to ignore the implementation unless thye do want to use a backgrond thread.
1 parent 73cc83d commit 5cec045

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Marille/IWorker.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ public interface IWorker<in T> : IDisposable, IAsyncDisposable where T : struct
99
/// <summary>
1010
/// Specifies if the worker should use a background thread to process the messages. If set to
1111
/// true the implementation of the worker should be thread safe.
12+
///
13+
/// The default implementation returns false.
1214
/// </summary>
13-
public bool UseBackgroundThread { get; }
15+
public bool UseBackgroundThread { get => false; }
1416

1517
/// <summary>
1618
/// Method that will be executed for every event in the channel that has been assigned

0 commit comments

Comments
 (0)