Class Network
The network class allows you execute, monitor and cancel data flows. You need to provide at least one start node to run the network. All other linked components will be retrieved automatically. If you provide more nodes, the algorithm will determine if a network has already started or not and ignore the other nodes. It is recommend to pass only one node from the network.
Inheritance
Inherited Members
Namespace: ETLBox.DataFlow
Assembly: ETLBox.dll
Syntax
public sealed class Network
Examples
Network.Execute(source1);
Network.Execute(source1, source2); //If source1 and source2 are in the same network, providing source2 is superflous
Task t = Network.ExecuteAsync(dest1);
t.Wait();
Constructors
Network()
Declaration
public Network()
Examples
Network.Execute(source1);
Network.Execute(source1, source2); //If source1 and source2 are in the same network, providing source2 is superflous
Task t = Network.ExecuteAsync(dest1);
t.Wait();
Network(params DataFlowComponent[])
Declaration
public Network(params DataFlowComponent[] startNodes)
Parameters
Type | Name | Description |
---|---|---|
DataFlowComponent[] | startNodes |
Examples
Network.Execute(source1);
Network.Execute(source1, source2); //If source1 and source2 are in the same network, providing source2 is superflous
Task t = Network.ExecuteAsync(dest1);
t.Wait();
Properties
Destinations
Declaration
public ICollection<IDataFlowDestination> Destinations { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.ICollection<T><IDataFlowDestination> |
Examples
Network.Execute(source1);
Network.Execute(source1, source2); //If source1 and source2 are in the same network, providing source2 is superflous
Task t = Network.ExecuteAsync(dest1);
t.Wait();
Sources
Declaration
public ICollection<IDataFlowExecutableSource> Sources { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.ICollection<T><IDataFlowExecutableSource> |
Examples
Network.Execute(source1);
Network.Execute(source1, source2); //If source1 and source2 are in the same network, providing source2 is superflous
Task t = Network.ExecuteAsync(dest1);
t.Wait();
StartNodes
Declaration
public ICollection<DataFlowComponent> StartNodes { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.ICollection<T><DataFlowComponent> |
Examples
Network.Execute(source1);
Network.Execute(source1, source2); //If source1 and source2 are in the same network, providing source2 is superflous
Task t = Network.ExecuteAsync(dest1);
t.Wait();
Methods
Cancel()
Cancel the BufferCompletion(s) on all nodes in the network, will start cancelation from the sources. This will result in all nodes canceled in the whole network.
Declaration
public void Cancel()
Cancel(params DataFlowComponent[])
Cancel the BufferCompletion(s) on all nodes in the network, will start cancelation from the sources. This will result in all nodes canceled in the whole network.
Declaration
public static void Cancel(params DataFlowComponent[] startNodes)
Parameters
Type | Name | Description |
---|---|---|
DataFlowComponent[] | startNodes | The start nodes - only one node in the whole network is sufficient |
Execute()
Will execute the data flow for the whole network synchronously. The network is derived from the given StartNodes (only one node of the network is needed)
Declaration
public void Execute()
Execute(params DataFlowComponent[])
Will execute the data flow for the whole network synchronously.
Declaration
public static void Execute(params DataFlowComponent[] startNodes)
Parameters
Type | Name | Description |
---|---|---|
DataFlowComponent[] | startNodes | At least one node in the network that should be executed
|
Execute(CancellationToken, params DataFlowComponent[])
Will execute the data flow for the whole network synchronously.
Declaration
public static void Execute(CancellationToken cancellationToken, params DataFlowComponent[] startNodes)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | A cancellation token which cancels the whole network when still running |
DataFlowComponent[] | startNodes | At least one node in the network that should be executed
|
Execute(CancellationToken)
Will execute the data flow for the whole network synchronously. The network is derived from the given StartNodes (only one node of the network is needed)
Declaration
public void Execute(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | The cancellation token to cancel the whole network when still running |
ExecuteAsync()
Will execute the data flow for the whole network asynchronously. The network is derived from the given StartNodes (only one node of the network is needed)
Declaration
public Task ExecuteAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task that is ran to completion when the whole network is completed. |
ExecuteAsync(params DataFlowComponent[])
Will execute the data flow for the whole network asynchronously.
Declaration
public static Task ExecuteAsync(params DataFlowComponent[] startNodes)
Parameters
Type | Name | Description |
---|---|---|
DataFlowComponent[] | startNodes | At least one node in the network that should be executed
|
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
ExecuteAsync(CancellationToken, params DataFlowComponent[])
Will execute the data flow for the whole network asynchronously.
Declaration
public static Task ExecuteAsync(CancellationToken cancellationToken, params DataFlowComponent[] startNodes)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | A cancellation token which cancels the whole network when still running |
DataFlowComponent[] | startNodes | At least one node in the network that should be executed
|
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
ExecuteAsync(CancellationToken)
Will execute the data flow for the whole network asynchronously. The network is derived from the given StartNodes (only one node of the network is needed)
Declaration
public Task ExecuteAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | A cancellation token to cancel the whole network when running |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task that is ran to completion when the whole network is completed. |