circuits + React

I’ve been hearing lots of good things about React (a JavaScript library to build User Interfaces) and recently came across the several tutorials that have a backend implementation in: PHP Python JavaScript Ruby Go I felt that there was one missing in particular and that of course is: circuits For those not familiar with circuits it is: A Python Application Framework Supports a loosely coupled architecture Is fully event-driven (i. [Read More]

A Docker-based mini-PaaS

A Docker-based mini-PaaS written in Python

The Why So by now everyone has heard of Docker right? (If not, you have some catching up to do!) Why have I created this mini-PaaS based around Docker? What’s wrong with the many myriad of platforms and services out there: Tutum AWS Deis Solum Flynn Well. Nothing! The various platforms, services and stacks that exist to service, deploy, monitor applications using Docker all have their use-cases and pros and cons. [Read More]

Getting started with circuits

Getting started quickly with circuits. An ASCIInema tutorial!

Here’s a quick ASCIInema tutorial I put together to show you how to get started with the circuits Asynchronous Event-Driven Application Framework for Python.

The code in this tutorial is as follows:

from circuits import Component, Event

class hello(Event):
    "hello Event"""


class App(Component):

    def hello(self, name="World!"):
        print "Hello {0:s}".format(name)
        return "Hello {0:s}".format(name)

Enjoy!

Come join us on #circuits on the FreeNode IRC Network

circuits + twisted

circuits + twisted integration

Well I’ve finally gone and done it! It’s still alpha at this stage but twisted applications, protocols and libraries can now run on top of circuits. Check out the code and samples: https://bitbucket.org/circuits/twistedintegration All you need to do is install the CircuitsReactor at the top of your module: import circuitsreactor circuitsreactor.install() Here’s a simple “Echo Server” example straight from twisted’s docs: #!/usr/bin/env python import circuitsreactor circuitsreactor.install() from twisted.internet import reactor from twisted. [Read More]

Introducing the circuits team

Lately circuits has seen some presence in the wild and this is a good thing for the project. Just the other day Crunch.io posted a job advert on the Python Job Board in need of a RESTful Web Developer to designer and build their public API(s). Naturally I sent them an email asking if they’d like to hire the lead developer of circuits (that’s me!) :) I thought it was about time I setup a circuits team repository on bitbucket to make things a little more prominent. [Read More]

Python Websockets Server with Circuits

Today marks the release of circuits-1.5 which brings to the circuits application framework a new circuits.web dispatcher. The WebSockets dispatcher This dispatcher allows you to build a web application that is capable of accepting WebSockets client connections on the same process/thread. Using circuits-1.5 here is a very simple Web Application that has WebSockets support and echos back every message it recieves: index.html: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1. [Read More]

Worker Pools with Circuits

For some time now I’ve been wanting to greatly improve the concurrency support in circuits and implement worker pools (using threads and/or processes). A few weeks ago I finally did that. I thought it would be hard at first until it hit me; circuits has all the tools necessary It turns out implementing “worker pools” in circuits is quite simple. All you need to do is construct a component that will start a number of other components as workers (either in thread mode or process mode). [Read More]

Testing With Mox

Last week I discovered the mocking library mox. I had previously known about the concept of mocking but had no experience in writing tests that mocked anything out… We use mocks quite a bit where I work and it was while implementing new functionality into our software that I learned also to write tests that used mocks (using the mox library/framework). The most challenging concept with mocking in general was deciding what to mock and what not to mock and how you should structure your test. [Read More]