-
Notifications
You must be signed in to change notification settings - Fork 2k
/
IStreamProviderRuntime.cs
83 lines (66 loc) · 3.15 KB
/
IStreamProviderRuntime.cs
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
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Orleans.Providers;
using Orleans.Runtime;
using Orleans.Streams.Core;
namespace Orleans.Streams
{
/// <summary>
/// Provider-facing interface for manager of streaming providers
/// </summary>
internal interface IStreamProviderRuntime : IProviderRuntime
{
/// <summary>
/// Retrieves the opaque identity of currently executing grain or client object.
/// </summary>
/// <remarks>Exposed for logging purposes.</remarks>
string ExecutingEntityIdentity();
/// <summary>
/// Returns the stream directory.
/// </summary>
/// <returns>The stream directory.</returns>
StreamDirectory GetStreamDirectory();
void RegisterSystemTarget(ISystemTarget target);
void UnregisterSystemTarget(ISystemTarget target);
/// <summary>
/// A Pub Sub runtime interface.
/// </summary>
/// <returns></returns>
IStreamPubSub PubSub(StreamPubSubType pubSubType);
/// <summary>A consistent ring interface.</summary>
/// <param name="mySubRangeIndex">Index of the silo in the ring.</param>
/// <param name="numSubRanges">Total number of sub ranges within this silo range.</param>
/// <returns></returns>
IConsistentRingProviderForGrains GetConsistentRingProvider(int mySubRangeIndex, int numSubRanges);
}
/// <summary>
/// Provider-facing interface for manager of streaming providers
/// </summary>
internal interface ISiloSideStreamProviderRuntime : IStreamProviderRuntime
{
/// <summary>Start the pulling agents for a given persistent stream provider.</summary>
Task<IPersistentStreamPullingManager> InitializePullingAgents(
string streamProviderName,
IQueueAdapterFactory adapterFactory,
IQueueAdapter queueAdapter);
}
public enum StreamPubSubType
{
ExplicitGrainBasedAndImplicit,
ExplicitGrainBasedOnly,
ImplicitOnly,
}
internal interface IStreamPubSub // Compare with: IPubSubRendezvousGrain
{
Task<ISet<PubSubSubscriptionState>> RegisterProducer(StreamId streamId, string streamProvider, IStreamProducerExtension streamProducer);
Task UnregisterProducer(StreamId streamId, string streamProvider, IStreamProducerExtension streamProducer);
Task RegisterConsumer(GuidId subscriptionId, StreamId streamId, string streamProvider, IStreamConsumerExtension streamConsumer, IStreamFilterPredicateWrapper filter);
Task UnregisterConsumer(GuidId subscriptionId, StreamId streamId, string streamProvider);
Task<int> ProducerCount(Guid streamId, string streamProvider, string streamNamespace);
Task<int> ConsumerCount(Guid streamId, string streamProvider, string streamNamespace);
Task<List<StreamSubscription>> GetAllSubscriptions(StreamId streamId, IStreamConsumerExtension streamConsumer = null);
GuidId CreateSubscriptionId(StreamId streamId, IStreamConsumerExtension streamConsumer);
Task<bool> FaultSubscription(StreamId streamId, GuidId subscriptionId);
}
}