Ejemplo n.º 1
0
        /// <summary>
        /// Search for node registration
        /// </summary>
        /// <param name="context"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task <IReadOnlyList <RouteLookupResponse> > Search(IWorkContext context, RouteLookupRequest request)
        {
            request.Verify(nameof(request)).IsNotNull();

            INodeRegistrationManagementActor managementActor = await _actorManager.CreateProxy <INodeRegistrationManagementActor>("default");

            IReadOnlyList <NodeRegistrationModel> registrations = await managementActor.List(context, request.SearchNodeId !);

            return(registrations
                   .Select(x => new RouteLookupResponse
            {
                NodeId = x.NodeId,
                InputUri = x.InputUri,
            })
                   .ToList());
        }
Ejemplo n.º 2
0
        private async Task TestAccess(IActorManager manager, ActorKey actorKey, CancellationToken token)
        {
            const string firstText = "first";

            ICache cache1 = await manager.CreateProxy <ICache>(actorKey);

            while (!token.IsCancellationRequested)
            {
                bool test = await cache1.IsCached(firstText);

                await cache1.Add(firstText);
            }
        }