| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx
jopen
9年前发布

微服务框架:Colossus

Colossus 是 Tumblr 出品的一个轻量级的框架用来构建高性能的应用,使用非堵塞网络 I/O。Colossus 主要侧重于开发低延迟、无状态的微服务,这个服务可以是一个简单的数据库或者缓存的抽象。Colossus 通过简单化实现最大化的性能需求。

Clean Event-based Programming

Built directly on NIO, Colossus is a modern take on event-based programming that fully leverages the functional and object-oriented features of Scala. Write powerful applications with minimal boilerplate.

Seamless Integration with Akka

Written entirely as Akka actors, Colossus makes it easy to connect your low-level event-handling code with external actors. Colossus also comes with a fully actor-based API if you wish to keep all your code inside actors.


Real-time Metrics

Colossus comes with a metrics aggregation and reporting system that makes it easy to track events in real-time. Common metrics like request rates and latency are built into services out of the box, and it's easy to add your own. A SQL-like DSL allows you to filter and aggregate over these metrics, while a reporting module lets you package and export metrics to an external database like OpenTSDB.

Write More than Just Services

While Colossus has primarily been built with microservices in mind, at the heart is a simple wrapper on NIO that is fully accessible for you to write your own custom servers and clients. Furthermore, Colossus Tasks let you write arbitrary code inside event loops when you need to do I/O outside the context of a server.

一个简单的服务:

import colossus._  import service._  import protocols.http._  import UrlParsing._  import HttpMethod._    object Main extends App {        implicit val io_system = IOSystem()      Service.become[Http]("http-echo", 9000){      case request @ Get on Root => request.ok("Hello world!")      case request @ Get on Root / "echo" / str => request.ok(str)    }  }

项目主页:http://www.open-open.com/lib/view/home/1416387161305

 本文由用户 jopen 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
 转载本站原创文章,请注明出处,并保留原始链接、图片水印。
 本站是一个以用户分享为主的开源技术平台,欢迎各类分享!
 本文地址:https://www.open-open.com/lib/view/open1416387161305.html
Colossus 网络工具包