private CompletableFuture < Snapshot > takeSnapshots ( ) { ComposableFuture < Snapshot > future = new ComposableFuture <> ( ) ; stateContext . execute ( ( ) -> { try { future . complete ( snapshot ( ) ) ; } catch ( Exception e ) { future . completeExceptionally ( e ) ; } } ) ; return future ; }
Takes and persists snapshots of provided services .