Skip to content

Instantly share code, notes, and snippets.

maiha

Block or report user

Report or block maiha

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@maiha
maiha / probeActorRef.scala
Created Aug 27, 2014
check a selection has active Actor or not
View probeActorRef.scala
private def probeActorRef(sel: ActorSelection): Unit = {
import scala.util.{Success, Failure}
import scala.concurrent.ExecutionContext.Implicits.global
import akka.util.Timeout
import scala.concurrent.duration._
implicit val timeout = Timeout(300.millis) // Timeout for the resolveOne call
sel.resolveOne().onComplete {
case Success(ref) =>
View DeadLetterWatcher.scala
import akka.actor._
import com.typesafe.scalalogging.slf4j.StrictLogging
/** DeadLetterを監視するactor
*/
object DeadLetterWatcher {
val actorName = "dead_letter_watcher"
def props(): Props = Props(new DeadLetterWatcher)
def apply(context: ActorRefFactory): ActorRef = context.actorOf(props(), actorName)
}
View build.sbt
scalaVersion := "2.11.2"
libraryDependencies ++= {
val v = "0.8.1"
("com.typesafe.akka" %% "akka-remote" % "2.3.5") ::
("org.scalaz" %% "scalaz-core" % "7.1.0") ::
("net.databinder" %% "unfiltered-jetty" % v) ::
("net.databinder" %% "unfiltered-filter" % v) ::
("com.chuusai" %% "shapeless" % "2.0.0") ::
("com.github.nscala-time" %% "nscala-time" % "1.4.0") ::
@maiha
maiha / UseAkkaActor.scala
Created Sep 5, 2014
use akka actor in gatling
View UseAkkaActor.scala
package study
/** gatling-2.0.0-RC3
* @example{
* ./bin/gatling.sh -nr -s study.UseAkkaActor
* }
*/
import io.gatling.core.Predef._
import io.gatling.http.Predef._
@maiha
maiha / InspectSession.scala
Created Sep 5, 2014
gatling-inspect-session
View InspectSession.scala
package study
/** gatling-2.0.0-RC3
* @example{
* ./bin/gatling.sh -nr -s study.InspectSession
* }
*/
import io.gatling.core.Predef._
import io.gatling.http.Predef._
@maiha
maiha / gatling.log
Created Sep 9, 2014
NPE at gatling-2.0.0-RC3
View gatling.log
17:39:00.605 [WARN ] i.g.h.a.AsyncHandlerActor - Request '/v1/jsevents' failed: java.lang.NullPointerException
[ERROR] [09/09/2014 17:39:00.642] [GatlingSystem-akka.actor.default-dispatcher-14] [akka://GatlingSystem/user/$h] null
java.io.IOException
at com.ning.http.client.providers.netty.request.NettyRequestSender.sendRequestWithCachedChannel(NettyRequestSender.java:222)
at com.ning.http.client.providers.netty.request.NettyRequestSender.sendRequestWithCertainForceConnect(NettyRequestSender.java:136)
at com.ning.http.client.providers.netty.request.NettyRequestSender.sendRequest(NettyRequestSender.java:113)
at com.ning.http.client.providers.netty.NettyAsyncHttpProvider.execute(NettyAsyncHttpProvider.java:86)
at com.ning.http.client.AsyncHttpClient.executeRequest(AsyncHttpClient.java:491)
at io.gatling.http.ahc.HttpEngine.startHttpTransaction(HttpEngine.scala:249)
at io.gatling.http.action.HttpRequestAction$.startHttpTransaction$1(HttpRequestAction.scala:3
@maiha
maiha / 1.Maiha.scala
Created Sep 22, 2014
FastCharSequence breaks EL (gatling-snapshot)
View 1.Maiha.scala
import io.gatling.core.Predef._
import io.gatling.http.Predef._
class Maiha extends Simulation {
val top =
exec(http("gatling.io")
.get("/")
.check(regex("""href="(.*?)"""").saveAs("url")) // should be "/assets/images/favicon.ico"
)
.exec(http("1st link")
View deadletter
(akka.remote.RemoteWatcher.Heartbeat$,1)
(akka.remote.transport.ActorTransportAdapter.DisassociateUnderlying,6)
(akka.remote.transport.AssociationHandle.InboundPayload,152)
(akka.remote.EndpointWriter.AckIdleCheckTimer$,12)
(akka.remote.EndpointWriter.BackoffTimer$,2)
(akka.remote.transport.AssociationHandle.Disassociated,8)
(akka.remote.transport.ProtocolStateActor.HandleListenerRegistered,4)
(akka.actor.FSM.Timer,4)
@maiha
maiha / 1.候補(OSS)
Last active Aug 29, 2015
scalaで使えるjob schedulerの調査 (2014.10.03)
View 1.候補(OSS)
a) akka.actor.Scheduler
* akka bundle
* 生akka系
* 永続化: なし
* 使用例: 'system.scheduler.scheduleOnce(8 hours, self, StartDeliveryWorkers)'
* akka: 2.3 ready
* 開発: 活発 (akkaに依存)
b) akka-quartz-scheduler
* https://github.com/enragedginger/akka-quartz-scheduler
View gist:4c039c23c16616a6bcd3
implicit
- implicit parameter
- implicit parameter method
- play request派
- implicit parameter constructor
- env派(環境引き回し)
- dynamic派
- implicit conversions
- Int seconds派
- implicit class
You can’t perform that action at this time.