Skip to content

Instantly share code, notes, and snippets.

@keitaroemotion
Created March 26, 2016 11:35
Show Gist options
  • Select an option

  • Save keitaroemotion/96e5074868ffa7e91bca to your computer and use it in GitHub Desktop.

Select an option

Save keitaroemotion/96e5074868ffa7e91bca to your computer and use it in GitHub Desktop.
import java.util.*;
import java.lang.Thread;
import java.util.concurrent.TimeUnit;
import lib.Stone;
import java.util.concurrent.ExecutorService;
public class Main{
public static void main(String args[]) {
multiThreadExample();
}
private static void displayFileContent(String param){
new Thread(() -> { Stone.putsLazy(Stone.readFile(param)); }).start();
}
private static void multiThreadExample() {
Stone.newList("etc/1", "etc/2").forEach( x -> displayFileContent(x));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment