Lamson Project Documentation

Writing A Lamson State Storage Backend

Earlier versions of Lamson assumed that you would use SQLAlchemy, and that you wouldn’t mind storing your state in the database using SQLAlchemy. Well, during the 0.9 redesign it became very easy to let you store the state however and wherever you want. In the new Lamson setup there is a bit more work to create alternative storage, but Lamson comes with two default stores that you can use to get started.

The Default Stores

Primary vs. Secondary Registration

When you design a Lamson application the question of “registration” comes up almost immediately. The question is one of how you find out who a person is so that you can interact with them. In the web world this involves a form of some kind asking for a login and password at a minimum. Some sites even go so far as to require a sign-up process before they let you see anything about the site, or even their marketing material.

On the web this kind of registration is what I like to call “Primary Registration”. It comes from the concept of primary vs. secondary data, or primary vs. secondary analysis. In the world of measurement a primary source is one that you gathered the information from directly, usually by giving them a questionaire. A secondary source is one that you gathered in some indirect way, either by evaluating past research in a new way, data mining, or simply unobtrusive data collection.

Installing Lamson Into Virtualenv With Pip

The best way to install Lamson in a virtualenv is using the pip tool to install it. This will automatically fetch the code from bazaar, install it inside the virtualenv and fetch any missing dependencies.

First, if you haven’t already, you’ll need to install pip. Make sure you’ve activated the virtualenv:

Available Lamson Commands

The following is also available by running lamson help and you can get the help for each individual command with lamson help -for COMMAND replacing COMMAND with one of these listed below.

The format for the printed options show default options as an actual setting, and required options as a CAPITALIZED setting you must give. For example, in the send command:

A Painless Introduction To Finite State Machines

Lamson uses the concept of a Finite State Machine to do the internal processing and keep track of what it should do next. You don’t necessarily need to know the details of how a FSM works, but it helps you if you want to know enough about Lamson to do advanced work. Most people could be blissfully unaware of state machines and still do plenty of work with Lamson.

Your Computer Science Class Sucked

Getting Started With Lamson

Lamson is designed to work like modern web application frameworks like Django, TurboGears, ASP.NET, Ruby on Rails, and whatever PHP is using these days. At every design decision Lamson tries to emulate terminology and features found in these frameworks. This Getting Started document will help you get through that terminology, get you started running your first lamson application, and walk you through the code you should read.

In total it should take you about 30 minutes to an hour to complete. If you just want to try Lamson, at least go through the 30 second introduction given first.

Filtering Spam With Lamson

Lamson supports initial use of the SpamBayes spam filter library for filtering spam. What Lamson provides is a set of easy to use decorators that you attach to your state functions which indicate that you want spam filtered. It also uses the default SpamBayes configuration files and database formats as you configure, so if you have an existing SpamBayes setup you should be able to use it right away.

Using lamson.spam

Frequently Asked Questions

If a question is missing you can contact me about it and I’ll answer.

What is Lamson?

Deferred Processing To Queues

As of the 0.9.2 release there is preliminary support for deferring handling of a mail message to a queue for another process to deal with in a separate handler. This support is rough at this time, but still useful and not too difficult to configure. As the feature gets more use it will improve and hopefully turn into a generic “defer to queue” system in Lamson.

What is meant by “defer to queue” is simply that you take messages your state function receives and you dump them into a maildir queue. You then have another separate process read from this queue and do the real work. Potentially you could have many processes deal with this work, and they could even be on multiple computers.