Skip to content

Instantly share code, notes, and snippets.

View ktoso's full-sized avatar
🗻
Life is Study!

Konrad `ktoso` Malawski ktoso

🗻
Life is Study!
View GitHub Profile
@ktoso
ktoso / out.txt
Last active April 19, 2016 10:09
Akka Streams: opening a new TCP connection if the server closes it
-----
asdf server (does nothing, then times out):
TIMEOUT: Exception `WEBrick::HTTPStatus::EOFError' at /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/webrick/httpserver.rb:80 - WEBrick::HTTPStatus::EOFError
-----
[info] Running akka.stream.will.WillApp
RECONNECT: start a new connection!
BECAUSE TCP CLOSED: [INFO] [02/11/2015 01:29:36.962] [default-akka.actor.default-dispatcher-3] [akka://default/system/IO-TCP-STREAM/client-1-%2F127.0.0.1%3A9292] Message [akka.io.Tcp$Closed$] from Actor[akka://default/system/IO-TCP/selectors/$a/0#234029134] to Actor[akka://default/system/IO-TCP-STREAM/client-1-%2F127.0.0.1%3A9292#49317068] was not delivered. [1] dead letters encountered. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
[INFO] [02/11/2015 01:29:36.962] [default-akka.actor.default-dispatcher-3] [akka://default/system/IO-TCP/selectors/$a/0] Message [akka.dispatch.sysmsg.DeathWatchNotification
object Fair {
final case class Ports[T]() extends FlexiPorts[T](name = "Fair") {
val input1 = createInputPort[T]()
val input2 = createInputPort[T]()
}
final case class Logic[T]() extends FlexiMerge[T, Ports[T]](Ports()) {
val readAny = State[T](ReadAny(ports.input1, ports.input2)) { (ctx, input, element) ⇒
bufSize
[error] /Users/ktoso/code/akka/akka-samples/akka-docs-java-lambda/src/test/java/docs/stream/FlowGraphDocTest.java:103: error: no suitable method found for closed(Sink<Integer,Future<Integer>>,Sink<Integer,Future<Integer>>,(b,top,bot[...]m); })
[error] FlowGraph.factory().closed(topHeadSink, bottomHeadSink, (b, top, bottom) -> {
[error] ^
[error] method GraphCreate.<S1#1,M#1>closed(Graph<S1#1,M#1>,Procedure2<Builder,S1#1>) is not applicable
[error] (cannot infer type-variable(s) S1#1,M#1
[error] (actual and formal argument lists differ in length))
[error] method GraphCreate.<S1#2,S2#1,M1#1,M2#1,M#2>closed(Graph<S1#2,M1#1>,Graph<S2#1,M2#1>,Function2<M1#1,M2#1,M#2>,Procedure3<Builder,S1#2,S2#1>) is not applicable
[error] (cannot infer type-variable(s) S1#2,S2#1,M1#1,M2#1,M#2
[error] (actual and formal argument lists differ in length))
[error] method GraphCreate.<S1#3,S2#2,S3#1,M1#2,M2#2,M3#1,M#3>closed(Graph<S1#3,M1#2>,Graph<S2#2,M2#2>,Graph<
package whoop.whoop
import java.util.concurrent.TimeUnit
import org.openjdk.jmh.annotations._
import scala.util.control.NoStackTrace
@State(Scope.Benchmark)
@BenchmarkMode(Array(Mode.AverageTime))
@ktoso
ktoso / structural_types_slow.scala
Last active August 29, 2015 14:16
structural types are slow :-)
package com.typesafe.benchmarks
import java.util.concurrent.TimeUnit
import org.openjdk.jmh.annotations._
@State(Scope.Benchmark)
@BenchmarkMode(Array(Mode.AverageTime))
@OutputTimeUnit(TimeUnit.NANOSECONDS)
class ReflectBenchmark {
@ktoso
ktoso / spec.scala
Created March 31, 2015 15:30
tck test for 1 element publisher
/**
* Copyright (C) 2014 Typesafe Inc. <http://www.typesafe.com>
*/
package akka.stream.tck
import akka.stream.impl.MaterializedValuePublisher
import org.reactivestreams.Publisher
class MaterializedValuePublisherTest extends AkkaPublisherVerification[Any] {
@ktoso
ktoso / processbuilder_creation.scala
Last active August 29, 2015 14:20
ProcessBuilder showdown!
/*
* Copyright (C) 2015 Typesafe Inc. <http://www.typesafe.com>
*/
package akka.benchmarks
import java.util.concurrent.TimeUnit
import org.openjdk.jmh.annotations._
$ sbt shell
[info] Loading global plugins from /Users/ktoso/.sbt/0.13/plugins
[info] Loading project definition from /Users/ktoso/code/reactive-platform-tools/project
[info] Updating {file:/Users/ktoso/code/reactive-platform-tools/project/}reactive-platform-tools-build...
[info] Resolving com.typesafe.dbuild#deploy_2.10;0.9.3-M2 ...
[error] Unable to find credentials for [Bintray @ dl.bintray.com].
[warn] module not found: com.typesafe.dbuild#deploy_2.10;0.9.3-M2
[warn] ==== typesafe-ivy-releases: tried
[warn] https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.dbuild/deploy_2.10/0.9.3-M2/ivys/ivy.xml
[warn] ==== sbt-plugin-releases: tried
validatePullRequest := Def.taskDyn {
val log = streams.value.log
val theVoid = Def.task { () }
if (projectIsAffectedByChanges.value) {
log.info(s"Changes in PR are affecting project [${name.value}] - proceeding with test:test")
theVoid.dependsOn(test in Test)
} else {
log.debug(s"Skipping validation of [${name.value}], as PR does NOT affect this project...")
theVoid