Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
public class LogProducingService {
private static final Logger LOGGER = LoggerFactory.getLogger(LogProducingService.class);
public void writeSomeLoggingStatements(String message) {"Let's assert some logs! " + message);
ExecutorService executor = Executors.newSingleThreadExecutor();
Future<?> future = executor.submit(() ->"This message is in a separate thread"));
do {
// wait for future to complete
} while (!future.isDone());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment