lib/dynflow/dispatcher/client_dispatcher.rb
def with_ping_request_caching(request, future)
        return yield unless request.is_a?(Dynflow::Dispatcher::Ping)
        return yield unless request.use_cache

        if @ping_cache.fresh_record?(request.receiver_id)
          future.fulfill(true)
        else
          if @ping_cache.executor?(request.receiver_id)
            future.reject false
          else
            yield
          end
        end
      end
# Tries to reduce the number of sent Ping requests by first looking into a cache. If the
# destination world is an executor world, the result is resolved solely from the cache.
# For client worlds the Ping might be sent if the cache record is stale.
#
# @param request [Dynflow::Dispatcher::Request] the request to send
# @param future [Concurrent::Future] the future to fulfill if the world was seen recently
# @return [Concurrent::Future] the future tracking the request
Tries to reduce the number of sent Ping requests by first looking into a cache. If the
destination world is an executor world, the result is resolved solely from the cache.
For client worlds the Ping might be sent if the cache record is stale.
Tries to reduce the number of sent Ping requests by first looking into a cache . If the destination world is an executor world the result is resolved solely from the cache . For client worlds the Ping might be sent if the cache record is stale .
def with_ping_request_caching(request, future)
        return yield unless request.is_a?(Dynflow::Dispatcher::Ping)
        return yield unless request.use_cache
        if @ping_cache.fresh_record?(request.receiver_id)
          future.fulfill(true)
        else
          if @ping_cache.executor?(request.receiver_id)
            future.reject false
          else
            yield
          end
        end
      end
def with_ping_request_caching ( request , future ) return yield unless request . is_a? ( Dynflow :: Dispatcher :: Ping ) return yield unless request . use_cache if @ping_cache . fresh_record? ( request . receiver_id ) future . fulfill ( true ) else if @ping_cache . executor? ( request . receiver_id ) future . reject false else yield end end end
Tries to reduce the number of sent Ping requests by first looking into a cache.
Tries to reduce the number of sent Ping requests by first looking into a cache .
the future tracking the request
the future tracking the request
Concurrent::Future
request
the request to send
the request to send
future
the future to fulfill if the world was seen recently
the future to fulfill if the world was seen recently