From 5ec6915a8f955c8ef72165e7392718a0b1f75bfa Mon Sep 17 00:00:00 2001
From: Manuel Traut <manut@mecka.net>
Date: Wed, 19 Feb 2014 09:36:54 +0100
Subject: middleware: add celery section and example

celery is a python framework for job execution

Signed-off-by: Manuel Traut <manut@mecka.net>
---
 frameworks/middleware/pres_middleware.tex | 77 +++++++++++++++++++++++++++++++
 1 file changed, 77 insertions(+)

(limited to 'frameworks/middleware/pres_middleware.tex')

diff --git a/frameworks/middleware/pres_middleware.tex b/frameworks/middleware/pres_middleware.tex
index c2933ba..c2eacc7 100644
--- a/frameworks/middleware/pres_middleware.tex
+++ b/frameworks/middleware/pres_middleware.tex
@@ -445,6 +445,83 @@ MyClient::message_rx(const QXmppMessage& msg)
 
 \subsection{Celery}
 
+\begin{frame}
+\frametitle{Overview}
+\begin{itemize}
+\item Distributed Task Queue
+\item based on message passing
+\item real-time operation and scheduling
+\item Tasks can be hosted on a single or on mulitple workers
+\item synchronous and asynchronous execution
+\item rate limit support
+\end{itemize}
+\end{frame}
+
+\begin{frame}
+\frametitle{implementations}
+\begin{itemize}
+\item celery-project: Python
+\item celery-php: PHP
+\end{itemize}
+\end{frame}
+
+\begin{frame}
+\frametitle{celeryproject}
+\begin{block}{supports multiple message broker}
+\begin{itemize}
+\item database: Django, or any supported by SQLAlchemy
+\item RabbitMQ
+\item Redis
+\item Amazon SQS (experimental)
+\end{itemize}
+\end{block}
+\end{frame}
+
+\begin{frame}
+\frametitle{celeryproject}
+\begin{block}{supports multiple result storage}
+\begin{itemize}
+\item database: any supported by SQLAlchemy
+\item memcached
+\item Redis
+\item AMQP
+\item Cassandra
+\item IronCache
+\end{itemize}
+\end{block}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{celeryproject, example}
+exec\_task.py
+\begin{lstlisting}{language=python}
+import os
+from celery import Celery
+
+app = Celery ('tasks', broker='sqla+sqlite:///celerydb.sqlite)
+
+@app.task
+def execute (command):
+    os.system (command)
+\end{lstlisting}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{celeryproject, example}
+test.py
+\begin{lstlisting}{language=python}
+from exec_task import execute
+
+execute.delay ("echo hello world")
+\end{lstlisting}
+
+start the example:
+\begin{lstlisting}{language=bash}
+term1% celery -A exec_task worker
+term2% ./test.py
+\end{lstlisting}
+\dots an example using return values and exceptions is in the example dir
+\end{frame}
 
 
 \subsection{DDS}
-- 
cgit v1.2.3

