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 / check-pre-push-akka-persistence.sh
Created June 23, 2014 22:41
Build all the things that touch akka-persistence
#!/bin/sh
sbt shell <<HERE
project akka-docs
test
sphinx:generateHtml
project akka-sample-persistence-java
test
project akka-sample-persistence-scala
@ktoso
ktoso / varaccessbench.scala
Created July 17, 2014 09:35
Benching fastest way to keep logLevel publised safely - spoiler: volatile wins
/**
* Copyright (C) 2014 Typesafe Inc. <http://www.typesafe.com>
*/
package akka.event
import java.util.concurrent.TimeUnit
import akka.actor._
import akka.testkit._
import akka.event.Logging.LogLevel
@ktoso
ktoso / terminated_in_cluster.scala
Created July 17, 2014 12:31
Trying to debug remote terminated messages from a Pool that's all children have died.
package sample.cluster.simple
import akka.actor.Actor.Receive
import akka.routing.{Broadcast, RoundRobinPool}
import com.typesafe.config.ConfigFactory
import akka.remote.RemoteScope
import akka.actor._
import scala.util.Random
@ktoso
ktoso / keybase.md
Created July 25, 2014 08:53
keybase.md

Keybase proof

I hereby claim:

  • I am ktoso on github.
  • I am ktoso (https://keybase.io/ktoso) on keybase.
  • I have a public key whose fingerprint is 858C 241C 59E3 A807 16B9 E4C4 9EDE 9520 2988 51A7

To claim this, I am signing this object:

@ktoso
ktoso / akka-streams-api-playground.scala
Created August 13, 2014 16:02
akka streams api playground
/**
* Copyright (C) 2014 Typesafe Inc. <http://www.typesafe.com>
*/
package akka.stream
import org.reactivestreams.{ Publisher, Subscriber }
class Experiments {
trait Graph {
# Reactive Streams TCK #
The purpose of the *Reactive Streams Technology Compatibility Kit* (from here on refered to as: *the TCK*) is to guide
and help Reactive Streams library implementors to validate their implementations against the rules defined in [the Specification](https://github.com/reactive-streams/reactive-streams).
The TCK is implemented using plain Java and **TestNG** tests, and should be possible to use from other languages and testing libraries (such as Scala, Groovy, JRuby or others).
## Types of tests included in the TCK
The TCK aims to cover all rules defined in the Specification, however for some rules outlined in the Specification it is
/**
* Copyright (C) 2014 Typesafe Inc. <http://www.typesafe.com>
*/
package akka.stream.javadsl.japi;
import akka.stream.javadsl.MaterializedDrain;
import org.reactivestreams.Subscriber;
import java.util.concurrent.Future;
/**
* Copyright (C) 2014 Typesafe Inc. <http://www.typesafe.com>
*/
package akka.stream.javadsl.japi;
import org.reactivestreams.Subscriber;
import java.util.concurrent.Future;
public class JavaPain {
trait DrainWithKey[-In, +MaterializedType] extends Drain[In, MaterializedType] {
// type MaterializedType
/**
* Attach this drain to the given [[org.reactivestreams.Publisher]]. Using the given
* [[FlowMaterializer]] is completely optional, especially if this drain belongs to
* a different Reactive Streams implementation. It is the responsibility of the
* caller to provide a suitable FlowMaterializer that can be used for running
* Flows if necessary.
FoldDrain<String, String> fold = new FoldDrain<String, String>();
Future<String> got = materialized.getDrainFor(fold);
}
}
class FoldDrain<In, Res> extends DrainWithTheKey<In, Future<Res>> { }
class DrainWithTheKey<In, Res> {
public Res something() { return null; }
}