public ScaleoutSubscription(string identity,
IList <string> eventKeys,
string cursor,
IList <ScaleoutMappingStore> stores,
Func <MessageResult, object, Task <bool> > callback,
int maxMessages,
IPerformanceCounterManager counters,
object state)
: base(identity, eventKeys, callback, maxMessages, counters, state)
{
if (stores == null)
{
throw new ArgumentNullException("stores");
}
_stores = stores;
List <Cursor> cursors = null;
if (String.IsNullOrEmpty(cursor))
{
cursors = new List <Cursor>(stores.Count);
for (int i = 0; i < stores.Count; i++)
{
cursors.Add(new Cursor(i.ToString(CultureInfo.InvariantCulture), stores[i].MaxKey));
}
}
else
{
cursors = Cursor.GetCursors(cursor);
}
_cursors = cursors;
}