用于编写分布式、容错和可扩展Internet应用程序的框架
spinoff的Python项目详细描述
概述
spinoff是一个用python编写分布式、容错和可伸缩应用程序的框架。<;a href=“http://travis-ci.org/eallik/spinoff”title=“travis ci.org上的衍生工具”>;<;img src=“https://secure.travis-ci.org/eallik/spinoff.png?branch=master”alt=“&;lt;在travis ci.org上生成状态指示器/eallik/衍生工具&;gt;”/>;<;a>;
派生基于[actor model](http://en.wikipedia.org/wiki/Actor_model)并借用[akka](http://akka.io)(位置透明、actor引用等)和[erlang](http://en.wikipedia.org/wiki/Erlang_(programming_language))(进程,nodename@hosthost样式节点引用(尚未实现)。
派生已使用[gevent](http://gevent.org/)和[zeromq](http://www.zeromq.org/)进行远程处理。
剥离目前正在不断开发中,但仍然可以用于编写实际的应用程序它也可以对自己代码中的一些错误进行容错。
炒作
>;“不管怎样,使用所有这些工具进行剥离真的非常好 >;因为在里面写代码很便宜 >;它在制作快速原型方面非常出色“\u
…所以我们希望有一天这里会有一个证明,说“它真的很适合制作生产软件”。
示例
以下只是一个非常小的“预览”样式的示例,说明框架可以做什么。更多的例子和完整的文档将很快跟进。
请参见[spinoff/examples/example1.py](spinoff/examples/example1.py)
可以使用以下命令运行示例:
`bash $ spin spinoff.examples.example1.ExampleProcess `
或
`bash $ spin spinoff.examples.example1.ExampleProcess `
分布式示例(带远程处理)
请参见[spinoff/examples/example2.py](spinoff/examples/example2.py)
可以使用以下命令运行示例:
`bash $ spin -pid node1.pid -nid localhost:9700 spinoff.examples.example2.ExampleActor -name other $ spin -pid node2.pid -nid localhost:9701 spinoff.examples.example2.ExampleProcess -using"other_actor='localhost:9700/other'" `
无远程处理的相同分布式代码
下面的示例演示了如何在不涉及任何网络/远程处理的单个线程中运行相同的代码(未经修改)。这说明了使用派生编写的actors(components)是如何与其他actors连接的,因此可以被视为只包含纯域逻辑而不包含低级传输和拓扑细节的抽象组件。
请参见[微调/examples/example2_local.py](微调/examples/example2_local.py)
可以使用以下命令运行示例:
`bash $ spin spinoff.examples.example2_local.LocalApp `人们可能会问,有什么区别? 在远程处理框架(如CORBA和剥离)之间。不同之处在于,参与者定义了清晰的边界 可以使用远程处理,而不是将紧密耦合的逻辑流拆分为网络上的两个节点, 它仍然提供有效的输出,但性能会显著下降。这并不是说演员们 地点透明度不受这些问题的影响,但问题存在的程度可以说是一个秩序。 震级更低。
示例http服务器
参见[spinoff/examples/005_http.py](spinoff/examples/005_http.py)
可以使用以下命令运行示例:
`bash $ spin spinoff.examples.0005_http.Main `