Giter VIP home page Giter VIP logo

r0k3 / spinoff Goto Github PK

View Code? Open in Web Editor NEW

This project forked from erikkaplun/spinoff

0.0 2.0 0.0 2.97 MB

Spinoff is a framework for writing distributed, fault tolerant and scalable applications in Python. Spinoff is based on the Actor Model and borrows from Akka (location transparency, actor references, etc) and Erlang (process-like actors).

License: BSD 2-Clause "Simplified" License

Python 98.77% CSS 0.85% HTML 0.37%

spinoff's Introduction

Overview

Spinoff is a framework for writing distributed, fault tolerant and scalable applications in Python. <build status indicator on travis-ci.org/eallik/spinoff>

Spinoff is based on the Actor Model and borrows from Akka (location transparency, actor references, etc) and Erlang (processes, nodename@hosthost style node references (not implemented yet)).

Spinoff has been built using Gevent and ZeroMQ for remoting.

Spinoff is currently under continuous development but is nevertheless usable for writing real applications—it can also be fault tolerant towards some of the bugs in its own code.

Hype

"anyway, spinoff is really super nice to play with all this stuff because it's cheap to write code in it it really shines at making quick prototypes"

...so let's hope one day there will be a testimonial here saying "it really shines at making production software".

Example

The following is only a very small "peek preview" style example of what the framework can do. More examples and full documentation will follow soon.

See spinoff/examples/example1.py

The example can be run using the following command:

$ spin spinoff.examples.example1.ExampleProcess

or

$ spin spinoff.examples.example1.ExampleProcess

Distributed Example (with Remoting)

See spinoff/examples/example2.py

The example can be run using the following commands:

$ 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'"

Same Distributed Code without Remoting

The following example demonstrates how it's possible to run the same code, unmodified, in a single thread with no network/remoting involved whatsoever. It's an illustration of how actors (components) written using Spinoff are xagnostic of how they are wired to work with other actors and can thus be viewed as abstract components containing only pure domain logic and no low level transportation and topology details.

See spinoff/examples/example2_local.py

The example can be run using the following command:

bash $ spin spinoff.examples.example2_local.LocalApp

One might ask, then, what is the difference between remoting frameworks such as CORBA and Spinoff. The difference is that actors define clear boundaries where remoting could ever be used, as opposed to splitting a flow of tightly coupled logic into two nodes on the network, which, still providing valid output, can degrade in performance significantly. This is not to say that actors with location transparency suffer none of such issues but the extent to which the problem exists is, arguably, an order of magnitude lower.

Example HTTP server

See spinoff/examples/005_http.py

The example can be run using the following commands:

$ spin spinoff.examples.0005_http.Main

spinoff's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.