Skip to content

Instantly share code, notes, and snippets.

@disc99
disc99 / result.log
Last active December 29, 2016 10:47
.
./out
./out/result.log
./hello
./hello/.git
./hello/.git/refs
./hello/.git/refs/heads
./hello/.git/refs/heads/master
./hello/.git/refs/tags
./hello/.git/refs/remotes

grpc-gateway

コンパイル

protoc -I/usr/local/include -I. \
-I$GOPATH/src \
-I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
-I/usr/local/Cellar/protobuf/2.6.1/include \
--go_out=grpc:. \
uuid.proto
package example;
import lombok.Value;
import javax.validation.ConstraintViolation;
import javax.validation.Validator;
import javax.validation.constraints.AssertTrue;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

メッセージキュー

送信元アプリケーション(Publisher)はメッセージキューミドルウェア(Broker/Queue)に対してメッセージを書き込み、連携先からのレスポンスを待つこと無く次の処理を実行。 連携先アプリケーション(Subscriber)はキュー経由でメッセージを取得し処理を進める。

image

  • メッセージ指向
  • Message Passing + Queue
    • 複数オブジェクト間でのメッセージ受け渡し
    • 受け取ったメッセージをQueueに格納
  • 非同期・疎結合

TypeScriptメモ

2016/04/02時点

学習方法

学習、導入コストとリスク

  • ES5までに無い構文
    • 何れ覚える必要があるので、ESに関しては学習コストが無いに等しい
  • ESには無いTypeScriptの構文理解
public class FileSystemTest {
@Test
public void t1() throws Exception {
long startModified = f.lastModified();
Observable.interval(5, TimeUnit.SECONDS)
.map(i -> {
System.out.println("map ");
long l = f.lastModified();
if (l % 3 == 0) {
import java.nio.file.WatchEvent;
public class FileSystemEvent {
WatchEvent<?> watchEvent;
FileSystemEvent(WatchEvent<?> watchEvent) {
this.watchEvent = watchEvent;
}
package rxjava;
import com.google.common.base.Stopwatch;
import org.junit.Test;
import org.junit.experimental.runners.Enclosed;
import org.junit.runner.RunWith;
import rx.Notification;
import rx.Observable;
import rx.Observer;
import rx.Subscriber;
@Test
public void Functionのdefaultメソッド() throws Exception {
Function<String, String> s1 = s -> s + "1";
Function<String, String> s2 = s -> s + "2";
Function<String, String> s3 = s -> s + "3";
// andThen
String res1 = s1.andThen(s2).andThen(s3).apply("start:");
assertThat(res1, is("start:123"));