forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIServiceGateway.cs
More file actions
61 lines (52 loc) · 1.97 KB
/
Copy pathIServiceGateway.cs
File metadata and controls
61 lines (52 loc) · 1.97 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
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace ServiceStack
{
/// <summary>
/// The minimal API Surface to capture the most common SYNC requests.
/// Convenience extensions over these core API's available in ServiceGatewayExtensions
/// </summary>
public interface IServiceGateway
{
/// <summary>
/// Normal Request/Reply Services
/// </summary>
TResponse Send<TResponse>(object requestDto);
/// <summary>
/// Auto Batched Request/Reply Requests
/// </summary>
List<TResponse> SendAll<TResponse>(IEnumerable<object> requestDtos);
/// <summary>
/// OneWay Service
/// </summary>
void Publish(object requestDto);
/// <summary>
/// Auto Batched OneWay Requests
/// </summary>
void PublishAll(IEnumerable<object> requestDtos);
}
/// <summary>
/// The minimal API Surface to capture the most common ASYNC requests.
/// Convenience extensions over these core API's available in ServiceGatewayExtensions
/// </summary>
public interface IServiceGatewayAsync
{
/// <summary>
/// Normal Request/Reply Services
/// </summary>
Task<TResponse> SendAsync<TResponse>(object requestDto, CancellationToken token = default(CancellationToken));
/// <summary>
/// Auto Batched Request/Reply Requests
/// </summary>
Task<List<TResponse>> SendAllAsync<TResponse>(IEnumerable<object> requestDtos, CancellationToken token = default(CancellationToken));
/// <summary>
/// OneWay Service
/// </summary>
Task PublishAsync(object requestDto, CancellationToken token = default(CancellationToken));
/// <summary>
/// Auto Batched OneWay Requests
/// </summary>
Task PublishAllAsync(IEnumerable<object> requestDtos, CancellationToken token = default(CancellationToken));
}
}