@Test void shouldLimitNumberOfInFlightRequests() { provider.getEth1Block(ONE).reportExceptions(); provider.getEth1Block(TWO).reportExceptions(); provider.getEth1Block(THREE).reportExceptions(); provider.getEth1Block(FOUR).reportExceptions(); verify(delegateProvider).getEth1Block(ONE); verify(delegateProvider).getEth1Block(TWO); verify(delegateProvider).getEth1Block(THREE); verifyNoMoreInteractions(delegateProvider); }
@Override public SafeFuture<Block> getEth1Block(final UInt64 blockNumber) { return queueRequest(() -> delegate.getEth1Block(blockNumber)); }
ThrottlingEth1Provider implements Eth1Provider { @Override public SafeFuture<Block> getEth1Block(final UInt64 blockNumber) { return queueRequest(() -> delegate.getEth1Block(blockNumber)); } }
ThrottlingEth1Provider implements Eth1Provider { @Override public SafeFuture<Block> getEth1Block(final UInt64 blockNumber) { return queueRequest(() -> delegate.getEth1Block(blockNumber)); } ThrottlingEth1Provider(final Eth1Provider delegate, final int maximumConcurrentRequests); }
ThrottlingEth1Provider implements Eth1Provider { @Override public SafeFuture<Block> getEth1Block(final UInt64 blockNumber) { return queueRequest(() -> delegate.getEth1Block(blockNumber)); } ThrottlingEth1Provider(final Eth1Provider delegate, final int maximumConcurrentRequests); @Override SafeFuture<Block> getEth1Block(final UInt64 blockNumber); @Override SafeFuture<Block> getGuaranteedEth1Block(final String blockHash); @Override SafeFuture<Block> getGuaranteedEth1Block(final UInt64 blockNumber); @Override SafeFuture<Block> getEth1Block(final String blockHash); @Override SafeFuture<Block> getLatestEth1Block(); @Override SafeFuture<EthCall> ethCall(
      final String from, final String to, final String data, final UInt64 blockNumber); }
ThrottlingEth1Provider implements Eth1Provider { @Override public SafeFuture<Block> getEth1Block(final UInt64 blockNumber) { return queueRequest(() -> delegate.getEth1Block(blockNumber)); } ThrottlingEth1Provider(final Eth1Provider delegate, final int maximumConcurrentRequests); @Override SafeFuture<Block> getEth1Block(final UInt64 blockNumber); @Override SafeFuture<Block> getGuaranteedEth1Block(final String blockHash); @Override SafeFuture<Block> getGuaranteedEth1Block(final UInt64 blockNumber); @Override SafeFuture<Block> getEth1Block(final String blockHash); @Override SafeFuture<Block> getLatestEth1Block(); @Override SafeFuture<EthCall> ethCall(
      final String from, final String to, final String data, final UInt64 blockNumber);  }