Skip to content

Commit e448d9f

Browse files
committed
Merge branch 'develop'
2 parents b76692c + d794813 commit e448d9f

93 files changed

Lines changed: 1643 additions & 1871 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Streamliner
2-
A .NET 6 library that enables the creation of code workflows that isolate responsibilities.
2+
A .NET 7 library that enables the creation of code workflows that isolate responsibilities.
33
Streamliner creates a directed acyclic graph which represents the workflow in separate, single responsibility blocks.
44

55
For the .NET Core 3.1 version, please refer to the [respectful branch](https://github.com/Codeh4ck/Streamliner/tree/dotnet-core-3.1).
6+
For .NET 6, install version 1.3.x from NuGet.
67

78
### Check the [examples](https://github.com/Codeh4ck/Streamliner/tree/examples) branch for example projects.
89

Streamliner/Actions/BlockActionBase.cs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22
using Streamliner.Core.Utilities.Auditing;
33
using Streamliner.Definitions.Metadata.Blocks;
44

5-
namespace Streamliner.Actions
5+
namespace Streamliner.Actions;
6+
7+
public abstract class BlockActionBase : Runnable
68
{
7-
public abstract class BlockActionBase : Runnable
8-
{
9-
public object Context { get; set; }
10-
public ILogger Logger { get; set; }
11-
public BlockHeader Header { get; set; }
9+
public object Context { get; set; }
10+
public ILogger Logger { get; set; }
11+
public BlockHeader Header { get; set; }
1212

13-
protected override void OnStart(object context = null) { }
14-
protected override void OnStop() { }
15-
}
16-
}
13+
protected override void OnStart(object context = null) { }
14+
protected override void OnStop() { }
15+
}
Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,21 @@
11
using System;
22
using Streamliner.Core.Utilities;
33

4-
namespace Streamliner.Actions
4+
namespace Streamliner.Actions;
5+
6+
public class BlockActionIocFactory : IBlockActionFactory
57
{
6-
public class BlockActionIocFactory : IBlockActionFactory
7-
{
8-
private readonly DependencyRegistrar _registrar;
8+
private readonly DependencyRegistrar _registrar;
99

10-
public BlockActionIocFactory(DependencyRegistrar registrar)
11-
{
12-
if (registrar == null) throw new ArgumentNullException(nameof(registrar));
13-
_registrar = registrar;
14-
}
10+
public BlockActionIocFactory(DependencyRegistrar registrar) =>
11+
_registrar = registrar ?? throw new ArgumentNullException(nameof(registrar));
1512

16-
public ProducerBlockActionBase<T> CreateProducerAction<T>(Type type)
17-
{
18-
return (ProducerBlockActionBase<T>) _registrar.Resolve(type);
19-
}
13+
public ProducerBlockActionBase<T> CreateProducerAction<T>(Type type) =>
14+
(ProducerBlockActionBase<T>) _registrar.Resolve(type);
2015

21-
public TransformerBlockActionBase<TIn, TOut> CreateTransformerAction<TIn, TOut>(Type type)
22-
{
23-
return (TransformerBlockActionBase<TIn, TOut>) _registrar.Resolve(type);
24-
}
16+
public TransformerBlockActionBase<TIn, TOut> CreateTransformerAction<TIn, TOut>(Type type) =>
17+
(TransformerBlockActionBase<TIn, TOut>) _registrar.Resolve(type);
2518

26-
public ConsumerBlockActionBase<TOut> CreateConsumerAction<TOut>(Type type)
27-
{
28-
return (ConsumerBlockActionBase<TOut>) _registrar.Resolve(type);
29-
}
30-
}
31-
}
19+
public ConsumerBlockActionBase<TOut> CreateConsumerAction<TOut>(Type type) =>
20+
(ConsumerBlockActionBase<TOut>) _registrar.Resolve(type);
21+
}
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
using System.Threading;
22

3-
namespace Streamliner.Actions
3+
namespace Streamliner.Actions;
4+
5+
public abstract class ConsumerBlockActionBase<TIn> : BlockActionBase
46
{
5-
public abstract class ConsumerBlockActionBase<TIn> : BlockActionBase
6-
{
7-
public abstract void Consume(TIn model, CancellationToken token = default(CancellationToken));
8-
}
9-
}
7+
public abstract void Consume(TIn model, CancellationToken token = default);
8+
}
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
using System;
22

3-
namespace Streamliner.Actions
3+
namespace Streamliner.Actions;
4+
5+
public interface IBlockActionFactory
46
{
5-
public interface IBlockActionFactory
6-
{
7-
ProducerBlockActionBase<T> CreateProducerAction<T>(Type type);
8-
TransformerBlockActionBase<TIn, TOut> CreateTransformerAction<TIn, TOut>(Type type);
9-
ConsumerBlockActionBase<TOut> CreateConsumerAction<TOut>(Type type);
10-
}
11-
}
7+
ProducerBlockActionBase<T> CreateProducerAction<T>(Type type);
8+
TransformerBlockActionBase<TIn, TOut> CreateTransformerAction<TIn, TOut>(Type type);
9+
ConsumerBlockActionBase<TOut> CreateConsumerAction<TOut>(Type type);
10+
}
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
using System.Threading;
22

3-
namespace Streamliner.Actions
3+
namespace Streamliner.Actions;
4+
5+
public abstract class ProducerBlockActionBase<T> : BlockActionBase
46
{
5-
public abstract class ProducerBlockActionBase<T> : BlockActionBase
6-
{
7-
public abstract bool TryProduce(out T model, CancellationToken token = default(CancellationToken));
8-
}
9-
}
7+
public abstract bool TryProduce(out T model, CancellationToken token = default);
8+
}
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
using System.Threading;
22

3-
namespace Streamliner.Actions
3+
namespace Streamliner.Actions;
4+
5+
public abstract class TransformerBlockActionBase<TIn, TOut> : BlockActionBase
46
{
5-
public abstract class TransformerBlockActionBase<TIn, TOut> : BlockActionBase
6-
{
7-
public abstract bool TryTransform(TIn input, out TOut model, CancellationToken token = default(CancellationToken));
8-
}
9-
}
7+
public abstract bool TryTransform(TIn input, out TOut model, CancellationToken token = default);
8+
}
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
using System;
22

3-
namespace Streamliner.Actions
3+
namespace Streamliner.Actions;
4+
5+
public class TriggerContext<T>
46
{
5-
public class TriggerContext<T>
6-
{
7-
public Guid? Id { get; set; }
8-
public T Item { get; set; }
9-
}
10-
}
7+
public Guid? Id { get; set; }
8+
public T Item { get; set; }
9+
}

0 commit comments

Comments
 (0)