会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Sangs
I want you to use all your power and skills
博客园
首页
新随笔
联系
管理
上一页
1
2
3
4
5
6
···
31
下一页
2015年7月28日
spray 处理 response 的通用函数
摘要: def handleActorResponse: PartialFunction[Try[Any], (StatusCode, ResponseResult)] = { case Failure(exp) => (InternalServerError, ResponseResul...
阅读全文
posted @ 2015-07-28 14:29 SangS
阅读(238)
评论(0)
推荐(0)
2015年7月21日
akka pubsub example
摘要: 测了一个小时的 Pubsub 模式,发现这个模式和自己预期的不太一样,具体表现在:1. 当 subscriber 订阅了某个 topic 并附带 groupName 时,如果 publish 发布的消息只含有 topic 而没有 groupName,那么该 subscriber 不会收到消息。而按照...
阅读全文
posted @ 2015-07-21 17:34 SangS
阅读(434)
评论(0)
推荐(0)
2015年7月16日
一个手写的 http client
摘要: public class HTTPClient { public static final String GET = "GET"; public static final String POST = "POST"; public static final String PUT = "PUT"; p...
阅读全文
posted @ 2015-07-16 10:30 SangS
阅读(514)
评论(0)
推荐(0)
2015年7月14日
scala get ipv4 address
摘要: scala 用 isInstanceOf 会报错(instanceof 这个函数就没有),java 下使用 instanceof 来判断是否是 Inet4Addresstest("get ipv4 address") { val ipAddr = InetAddress.getLocalHost....
阅读全文
posted @ 2015-07-14 08:27 SangS
阅读(610)
评论(0)
推荐(0)
2015年7月2日
akka cluster singleton
摘要: cluster singleton 需要注意的一点是ClusterSingletonProxy 必须和 ClusterSingletonManager 一起工作尝试过通过 path 来获得 singleton actor 的 actorRef,但是结果和期望的不同,具体的表现是,在 main 方法中...
阅读全文
posted @ 2015-07-02 17:02 SangS
阅读(852)
评论(0)
推荐(0)
akka cluster sharding
摘要: cluster sharding 的目的在于提供一个框架,方便实现 DDD,虽然我至今也没搞明白 DDD 到底适用于是什么场合,但是 cluster sharding 却是我目前在做的一个 project 扩展到集群上非常需要的工具。sharding 要做这么几件事1. 对于每一个 entity,创...
阅读全文
posted @ 2015-07-02 14:30 SangS
阅读(1588)
评论(0)
推荐(0)
akka cluster 初体验
摘要: cluster 配置akka { actor { provider = "akka.cluster.ClusterActorRefProvider" } remote { log-remote-lifecycle-events = off enabled-transports...
阅读全文
posted @ 2015-07-02 11:18 SangS
阅读(2045)
评论(0)
推荐(0)
actor 内最好不要阻塞
摘要: 1. 在使用 akka cluster singleton 时,我需要知道被创建的 singleton proxy 的 actorRef,通过绝对路径加 actorSelection 方法,应该很容易得到此 actor 的 actorRefmain() { system.actorOf(Clu...
阅读全文
posted @ 2015-07-02 10:35 SangS
阅读(929)
评论(0)
推荐(0)
2015年6月16日
学 shell (1/5)
摘要: 假设这是某脚本 x.sh 的内容,使用 sh x.sh arg1 来执行该脚本#!/bin/bashcd `dirname $0`/..source scripts/status.shstart $@第一行 #! /bin/bash 说明使用 bash 的位置第二行 ``内的代码会优先被执行,$0 ...
阅读全文
posted @ 2015-06-16 22:41 SangS
阅读(190)
评论(0)
推荐(0)
2015年6月10日
ctrl c 中文字符到 vnc 里,中文字符已经被转码
摘要: 为了测试程序对多语言字符的支持情况,我找来一段中文和北欧的文字,希望把这些文字上传到elasticsearch,并能正确显示。首先测试了北欧文字,一切OK。但是中文复制到 VNC 客户端(Linux)后却是问号,因为Linux本来就打不出中文,所以显示乱码我也没在意,我觉得中文的编码无非就是一坨二进...
阅读全文
posted @ 2015-06-10 22:48 SangS
阅读(4108)
评论(0)
推荐(1)
上一页
1
2
3
4
5
6
···
31
下一页