Class RequestManager<I,D>

java.lang.Object
me.hsgamer.hscore.request.RequestManager<I,D>
Type Parameters:
I - the type of the identifier
D - the type of the data

public class RequestManager<I,D> extends Object
The generic request manager
  • Constructor Details

    • RequestManager

      public RequestManager()
  • Method Details

    • addRequest

      public CompletableFuture<D> addRequest(I identifier)
      Add a request
      Parameters:
      identifier - the identifier
      Returns:
      the data future
    • removeRequests

      public void removeRequests(I identifier)
      Remove all requests
      Parameters:
      identifier - the identifier
    • removeRequest

      public void removeRequest(I identifier)
      Remove a request
      Parameters:
      identifier - the identifier
    • completeRequest

      public void completeRequest(I identifier, D data, boolean handleAll)
      Complete the request of the identifier
      Parameters:
      identifier - the identifier
      data - the data
      handleAll - if true, all requests will be completed
    • completeRequest

      public void completeRequest(I identifier, D data)
      Complete the request of the identifier. This method will handle only one request.
      Parameters:
      identifier - the identifier
      data - the data