Beispiel #1
0
        public override async Task <IOrleansQueryResult <TIGrain> > GetResults()
        {
            IIndexInterface index = base.IndexFactory.GetIndex(typeof(TIGrain), this._indexName);

            //the actual lookup for the query result to be streamed to the observer
            return((IOrleansQueryResult <TIGrain>) await index.Lookup(this._param));
        }
Beispiel #2
0
        public override async Task ObserveResults(IAsyncBatchObserver <TIGrain> observer)
        {
            IIndexInterface        index        = base.IndexFactory.GetIndex(typeof(TIGrain), this._indexName);
            IAsyncStream <TIGrain> resultStream = base.StreamProvider.GetStream <TIGrain>(Guid.NewGuid(), IndexUtils.GetIndexGrainPrimaryKey(typeof(TIGrain), this._indexName));

            IOrleansQueryResultStream <TIGrain> result = new OrleansQueryResultStream <TIGrain>(resultStream);

            //the observer is attached to the query result
            await result.SubscribeAsync(observer);

            //the actual lookup for the query result to be streamed to the observer
            await index.Lookup(result.Cast <IIndexableGrain>(), this._param);
        }