Java Code Examples for io.grpc.Deadline#Ticker

The following examples show how to use io.grpc.Deadline#Ticker . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractServerImplBuilder.java    From grpc-java with Apache License 2.0 4 votes vote down vote up
/**
 * Sets a custom deadline ticker.  This should only be called from InProcessServerBuilder.
 */
protected void setDeadlineTicker(Deadline.Ticker ticker) {
  this.ticker = checkNotNull(ticker, "ticker");
}
 
Example 2
Source File: FakeClock.java    From grpc-java with Apache License 2.0 4 votes vote down vote up
/**
 * Deadline ticker of the FakeClock.
 */
public Deadline.Ticker getDeadlineTicker() {
  return deadlineTicker;
}
 
Example 3
Source File: InProcessServerBuilder.java    From grpc-java with Apache License 2.0 2 votes vote down vote up
/**
 * Provides a custom deadline ticker that this server will use to create incoming {@link
 * Deadline}s.
 *
 * <p>This is intended for unit tests that fake out the clock.  You should also have a fake {@link
 * ScheduledExecutorService} whose clock is synchronized with this ticker and set it to {@link
 * #scheduledExecutorService}. DO NOT use this in production.
 *
 * @return this
 * @see Deadline#after(long, TimeUnit, Deadline.Ticker)
 *
 * @since 1.24.0
 */
public InProcessServerBuilder deadlineTicker(Deadline.Ticker ticker) {
  setDeadlineTicker(ticker);
  return this;
}