-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathIPipeline.cs
More file actions
86 lines (76 loc) · 2.98 KB
/
IPipeline.cs
File metadata and controls
86 lines (76 loc) · 2.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// Copyright (c) TensorStack. All rights reserved.
// Licensed under the Apache 2.0 License.
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace TensorStack.Common.Pipeline
{
/// <summary>
/// Basic IPipeline Interface
/// Extends the <see cref="IDisposable" />
/// </summary>
/// <seealso cref="IDisposable" />
public interface IPipeline : IDisposable
{
/// <summary>
/// Loads the pipeline.
/// </summary>
public Task LoadAsync(CancellationToken cancellationToken = default);
/// <summary>
/// Unloads the pipeline.
/// </summary>
public Task UnloadAsync(CancellationToken cancellationToken = default);
}
/// <summary>
/// Interface IPipeline
/// Extends the <see cref="TensorStack.Common.Pipeline.IPipeline" />
/// </summary>
/// <typeparam name="T">The return type</typeparam>
/// <typeparam name="O">The RunOptions type</typeparam>
/// <typeparam name="P">The RunProgress type</typeparam>
/// <seealso cref="TensorStack.Common.Pipeline.IPipeline" />
public interface IPipeline<T, O, P> : IPipeline
where T : class
where O : IRunOptions
where P : IRunProgress
{
Task<T> RunAsync(O options, IProgress<P> progressCallback = default, CancellationToken cancellationToken = default);
}
/// <summary>
/// Interface IPipeline
/// Extends the <see cref="TensorStack.Common.Pipeline.IPipeline" />
/// </summary>
/// <typeparam name="T">The return type</typeparam>
/// <typeparam name="O">The RunOptions type</typeparam>
/// <seealso cref="TensorStack.Common.Pipeline.IPipeline" />
public interface IPipeline<T, O> : IPipeline<T, O, RunProgress>
where T : class
where O : IRunOptions
{
}
/// <summary>Interface IPipelineStream
/// Extends the <see cref="T:TensorStack.Common.Pipeline.IPipeline" /></summary>
/// <typeparam name="T">Result type</typeparam>
/// <typeparam name="O">The RunOptions type</typeparam>
/// <typeparam name="P">The RunProgress type</typeparam>
public interface IPipelineStream<T, O, P> : IPipeline
where T : class
where O : IRunOptions
where P : IRunProgress
{
IAsyncEnumerable<T> RunAsync(O options, IProgress<P> progressCallback = default, CancellationToken cancellationToken = default);
}
/// <summary>
/// Interface IPipelineStream
/// Extends the <see cref="TensorStack.Common.Pipeline.IPipelineStream{T, O, TensorStack.Common.Pipeline.RunProgress}" />
/// </summary>
/// <typeparam name="T">Result type</typeparam>
/// <typeparam name="O">The RunOptions type</typeparam>
/// <seealso cref="TensorStack.Common.Pipeline.IPipelineStream{T, O, TensorStack.Common.Pipeline.RunProgress}" />
public interface IPipelineStream<T, O> : IPipelineStream<T, O, RunProgress>
where T : class
where O : IRunOptions
{
}
}