Ejemplo n.º 1
0
        /// <summary>
        /// TBD
        /// </summary>
        /// <param name="remoteAddress">TBD</param>
        /// <returns>TBD</returns>
        public override Task <AssociationHandle> Associate(Address remoteAddress)
        {
            var statusPromise = new TaskCompletionSource <AssociationHandle>();

            InterceptAssociate(SchemeAugmenter.RemoveScheme(remoteAddress), statusPromise);
            return(statusPromise.Task);
        }
Ejemplo n.º 2
0
        public Task <AkkaProtocolHandle> Associate(Address remoteAddress, int?refuseUid)
        {
            // Prepare a Task and pass its completion source to the manager
            var statusPromise = new TaskCompletionSource <AssociationHandle>();

            manager.Tell(new AssociateUnderlyingRefuseUid(SchemeAugmenter.RemoveScheme(remoteAddress), statusPromise, refuseUid));

            return(statusPromise.Task.CastTask <AssociationHandle, AkkaProtocolHandle>());
        }
Ejemplo n.º 3
0
        public Task <AkkaProtocolHandle> Associate(Address remoteAddress, int?refuseUid)
        {
            // Prepare a Task and pass its completion source to the manager
            var statusPromise = new TaskCompletionSource <AssociationHandle>();

            manager.Tell(new AssociateUnderlyingRefuseUid(SchemeAugmenter.RemoveScheme(remoteAddress), statusPromise, refuseUid));

            return(statusPromise.Task.ContinueWith(result => result.Result.AsInstanceOf <AkkaProtocolHandle>(),
                                                   TaskContinuationOptions.AttachedToParent | TaskContinuationOptions.ExecuteSynchronously));
        }