This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package statelessservice; | |
import java.io.BufferedReader; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.io.OutputStream; | |
import java.net.InetSocketAddress; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 以下の3つのプロジェクトをサブプロジェクトとして指定します。 | |
include 'ChatWeb' | |
include 'ChatData' | |
include ':ChatRPC' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'java' | |
apply plugin: 'eclipse' | |
// 全てのサブプロジェクトにJavaプラグインを使う設定です。 | |
subprojects { | |
apply plugin: 'java' | |
} | |
// タスクを指定しなかった場合、以下の順番でタスクが実行されるという | |
// 設定を全てのサブプロジェクトに対して行う設定です。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<ServiceManifest Name="ChatWebPkg" Version="1.0.0" xmlns="http://schemas.microsoft.com/2011/01/fabric" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<Description>Service that implements a ChatWeb service</Description> | |
<ServiceTypes> | |
<StatelessServiceType ServiceTypeName="ChatWebType" /> | |
</ServiceTypes> | |
<CodePackage Name="Code" Version="1.0.0"> | |
<EntryPoint> | |
<ExeHost> | |
<Program>entryPoint.sh</Program> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>ちゃっと</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | |
<style> | |
.chat-box { | |
width: 100%; | |
height: auto; | |
overflow: hidden; | |
margin-bottom: 20px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package thread.sample; | |
import java.util.Arrays; | |
import java.util.List; | |
import java.util.concurrent.CompletableFuture; | |
import java.util.concurrent.ExecutionException; | |
public class ComletableFutureSample4 { | |
public static void main(String[] args) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package thread.sample; | |
import java.util.concurrent.CompletableFuture; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import java.util.function.Consumer; | |
import java.util.function.Supplier; | |
public class ComletableFutureSample3 { | |
public static void main(String[] args) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package thread.sample; | |
import java.util.concurrent.CompletableFuture; | |
public class ComletableFutureSample2 { | |
public static void main(String[] args) { | |
// 戻り値が固定で決まっているときは、CompletableFutureのstaticメソッドの | |
// completedFutureを使います。 | |
CompletableFuture<?> cf = CompletableFuture.completedFuture("hoge"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package thread.sample; | |
import java.util.concurrent.CompletableFuture; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
public class ComletableFutureSample1 { | |
public static void main(String[] args) { | |
ExecutorService executor = Executors.newSingleThreadExecutor(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package thread.sample; | |
import java.util.concurrent.Callable; | |
import java.util.concurrent.ExecutionException; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.Future; | |
public class ExecutorSample2 { | |
public static void main(String[] args) throws InterruptedException, ExecutionException { |