Class CheckpointingFileDataSupplier

  • All Implemented Interfaces:
    java.lang.AutoCloseable , net.devslash.AfterHook , net.devslash.FullDataAfterHook , net.devslash.OnError , net.devslash.OnErrorWithState , net.devslash.RequestDataSupplier

    
    public final class CheckpointingFileDataSupplier
     implements RequestDataSupplier<List<String>>, FullDataAfterHook, AutoCloseable, OnErrorWithState
                        

    A checkpointing file data supplier works similarly to the FileDataSupplier in use under good conditions. When failing through, the checkpointing supplier will be able to capture those requests that did or didn't pass a predicate, and subsequently restart from a known state.

    A caveat to this, is that depending on the side-effects of the server being called. It is possible that the request (or at least the data mutation effects) have completed from the server.

    This means, that this should only be used in the event that the server requests are idempotent. Or retry is safe.

    There is a startup cost to using this data supplier as well, as it has to take an exclusive copy of the request data.

    Checkpoint data suppliers only create List<String> request data. This ensures serialization isn't something we have to worry about.. Maybe another day.

    A checkpointing supplier is also not expected to work

    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Unit inject(CallBuilder<List<String>> callBuilder)
      RequestData<List<String>> getDataForRequest()
      Unit accept(HttpRequest req, HttpResponse resp, RequestData<?> data)
      <T extends Any> Unit accept(Channel<Envelope<Pair<HttpRequest, RequestData<T>>>> channel, Envelope<Pair<HttpRequest, RequestData<T>>> envelope, Exception e)
      Unit close()
      • Methods inherited from class net.devslash.RequestDataSupplier

        init
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait