Github user mdunker commented on a diff in the pull request:

    https://github.com/apache/usergrid/pull/584#discussion_r150592038
  
    --- Diff: 
stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/direct/BufferedQueueImpl.java
 ---
    @@ -0,0 +1,191 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +package org.apache.usergrid.corepersistence.asyncevents.direct;
    +
    +
    +import java.util.ArrayList;
    +import java.util.List;
    +import java.util.concurrent.*;
    +import java.util.function.Consumer;
    +
    +/**
    + * Bufferes events and dispatched then in batches.
    + * Ensures that the callback will be called at a min interval.
    + */
    +public class BufferedQueueImpl<T> implements BufferedQueue<T> {
    +
    +    private String fileName = "my_file_name.txt";
    +    private Consumer<List<T>> consumer;
    +
    +    ScheduledThreadPoolExecutor threadPool = new 
ScheduledThreadPoolExecutor(1);
    --- End diff --
    
    add comment if implementation requires only one thread be used


---

Reply via email to