예제 #1
0
            private void OnStoreUpdate(string id)
            {
                if (id != this.loadKey)
                {
                    return;
                }
                Entity <DataType> entity;

                if (!store.GetEntity(this.loadKey, out entity))
                {
                    CompleteWithError(
                        "entity not tracked in store (expected in progress or complete)"
                        );
                    return;
                }
                ResolveStatus stat = entity.status;

                if (stat.isResolveInProgress)
                {
                    return;
                }
                if (!stat.hasResolved)
                {
                    CompleteWithError(stat.resolveError ?? "not found");
                    return;
                }
                this.item = entity.data;
                CompleteRequest();
            }
예제 #2
0
            private void OnStoreUpdate(string id)
            {
                if (id != this.loadKey)
                {
                    return;
                }
                Entity <DataType> entity;

                if (!store.GetEntity(this.loadKey, out entity))
                {
                    var err = "entity not tracked in store (expected in progress or complete)";
                    this.item = ResolveResultDTO <DataType> .ResolveError(
                        this.requestDTO, err
                        );

                    CompleteWithError(err);
                    return;
                }
                ResolveStatus stat = entity.status;

                if (stat.isResolveInProgress)
                {
                    return;
                }
                if (!stat.hasResolved)
                {
                    var err = stat.resolveError ?? "not found";
                    this.item = ResolveResultDTO <DataType> .ResolveError(
                        this.requestDTO, err
                        );

                    CompleteWithError(err);
                    return;
                }
                this.item = ResolveResultDTO <DataType> .ResolveSucceeded(
                    this.requestDTO, entity.id, entity.data,
                    stat.maxAgeSecs, stat.timestamp
                    );

                CompleteRequest();
            }
예제 #3
0
 public abstract bool GetResolveStatus(string id, out ResolveStatus status);