Moved to skeeto/scratch/aidrivers
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
#!/usr/bin/perl | |
use warnings; | |
use strict; | |
my $bin=$ARGV[0]; | |
my @line = split /\s+/, `nm $bin |grep runtime.buildVersion`; | |
my $addr = hex($line[0]); | |
my $end = $addr + 16; |
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 org.iainhull.akka | |
import scala.concurrent.duration._ | |
import akka.actor._ | |
import akka.event.Logging | |
import akka.pattern.ask | |
import akka.util.Timeout | |
import akka.persistence.{PersistentView, AtLeastOnceDelivery, PersistentActor} |
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 demo | |
import akka.actor.{Props, ActorSystem} | |
import akka.persistence.PersistentActor | |
object PingPong extends App { | |
case object Ball // The Command | |
case object BallReceived // The Domain Event, represents a Fact, something that have already happened | |
class Ping extends PersistentActor { |
Slightly disorganized but reasonably complete notes on the algorithms, strategies and optimizations of the Akka Cluster implementation. Could use a lot more links and context etc., but was just written for my own understanding. Might be expanded later.
Links to papers and talks that have inspired the implementation can be found on the 10 last pages of this presentation.
This is the Gossip state representation:
Rank Author : Title (Year)
- Herbert, Frank : Dune (1965)
- Card, Orson Scott : Ender's Game (1985)
- Asimov, Isaac : The Foundation Trilogy (1953)
- Simmons, Dan : Hyperion (1989)
- Le Guin, Ursula K. : The Left Hand of Darkness (1969)
- Adams, Douglas : The Hitchhiker's Guide to the Galaxy (1979)
- Orwell, George : Nineteen Eighty-Four (1949)
- Gibson, William : Neuromancer (1984)
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
import scala.collection.immutable | |
import scala.collection.immutable.Queue | |
import akka.actor._ | |
/** | |
* Rough, initial cut of a trait to mixin when an Actor requires | |
* initalization, where the initialization is long and arduous (for | |
* example, data initialization related). This strategy allows the | |
* implementing actor to delegate the work to another Actor, on a | |
* separate, dedicated Dispatcher, and not block any other related |
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" | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
compile ( | |
"org.jboss.netty:netty:latest.integration", |
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
import java.io.IOException; | |
import java.net.InetSocketAddress; | |
import java.net.ServerSocket; | |
import java.net.StandardSocketOptions; | |
import java.nio.ByteBuffer; | |
import java.nio.channels.CancelledKeyException; | |
import java.nio.channels.ReadableByteChannel; | |
import java.nio.channels.SelectionKey; | |
import java.nio.channels.Selector; | |
import java.nio.channels.ServerSocketChannel; |