deepstream数据同步和消息传递引擎
deepstream.io 宣布发布 deepstream 2.0,一个百万级数据同步和消息传递的引擎。服务器和客户端基于 WebSockets 协议通讯。提供多种语言的客户端开发包,包括可直接在浏览器使用的 JavaScript 包。
deepstream 的使用场景:
协作应用,例如 Google Docs 或者 Trello 之类
快速贸易、拍卖平台
消息传递和社交交互平台
金融报表和风险控制
赌场或者是多玩家的手机游戏
实习的统计分析和监控系统
物联网数据采集和控制系统
股票和库存控制
过程管理系统
其声称基准测试比 Socket.IO 快出1000倍!https://deepstream.io/blog/deepstream-2.0-more-than-1000-times-faster-than-socket.io/
示例代码:
// get the record
var driver = client.record.getRecord( 'driver/14' );
// subscribe to any changes within position
driver.subscribe( 'position', function( position ){
updateMarker( position.x, position.y );
});
Android 代码:
// implements android.location.LocationListener
public void onLocationChanged(Location location) {
// get the record
Record record = client.record.getRecord( "driver/14" );
// any kind of data path works
record.set( "position.x", location.getLongitude() );
//as well as any kind of serializable datatype
record.set( "position.y", location.getLatitude() );
}
评论
