Code example for ConcurrentLinkedQueue

Methods: poll

0
  public void injectFailureEvent(CoronaFailureEvent event) {
    failureEventQueue.offer(event);
  } 
   
  public CoronaFailureEvent pollFailureEvent() { 
    return failureEventQueue.poll();
  } 
   
  public static CoronaFailureEventInjector getInjectorFromStrings (String [] events, int start) {
    if (start >= events.length) {
      return null; 
    } 
     
    CoronaFailureEventInjector injector = new CoronaFailureEventInjector();
    for (int i = start; i < events.length; ++ i) {
      CoronaFailureEvent event = CoronaFailureEvent.fromString(events[i]);
      if (event == null) {
        if (i == start) {
          return null; 
        } else {