private Task <SetThrottleAck> SetMode(Address nakedAddress, ThrottlerHandle handle)
        {
            Tuple <ThrottleMode, ThrottleTransportAdapter.Direction> mode;

            if (_throttlingModes.TryGetValue(nakedAddress, out mode))
            {
                return(SetMode(handle, mode.Item1, mode.Item2));
            }
            return(SetMode(handle, Unthrottled.Instance, ThrottleTransportAdapter.Direction.Both));
        }
 private Task <SetThrottleAck> SetMode(ThrottlerHandle handle, ThrottleMode mode,
                                       ThrottleTransportAdapter.Direction direction)
 {
     if (direction == ThrottleTransportAdapter.Direction.Both ||
         direction == ThrottleTransportAdapter.Direction.Send)
     {
         handle.OutboundThrottleMode.Value = mode;
     }
     if (direction == ThrottleTransportAdapter.Direction.Both ||
         direction == ThrottleTransportAdapter.Direction.Receive)
     {
         return(AskModeWithDeathCompletion(handle.ThrottlerActor, mode, ActorTransportAdapter.AskTimeout));
     }
     else
     {
         return(Task.FromResult(SetThrottleAck.Instance));
     }
 }
Пример #3
0
 /// <summary>
 /// TBD
 /// </summary>
 /// <param name="throttlerHandle">TBD</param>
 public Handle(ThrottlerHandle throttlerHandle)
 {
     ThrottlerHandle = throttlerHandle;
 }
Пример #4
0
 /// <summary>
 /// TBD
 /// </summary>
 /// <param name="origin">TBD</param>
 /// <param name="handle">TBD</param>
 public Checkin(Address origin, ThrottlerHandle handle)
 {
     ThrottlerHandle = handle;
     Origin          = origin;
 }
 public ExposedHandle(ThrottlerHandle handle)
 {
     Handle = handle;
 }