VASmalltalk – Seaside in collaboration with 0MQ and Mongrel2

I have talked with Sebastian Heidbrink over quite a long period of time how to do interprocess communication fom VASalltalk with other languages or system. A solution to this problem might brings us to multiple-processor solutions, quite difficult with today single-threaded virtual machines. And we wanted to have VASmalltalk solutions using multiple threads at once.

Another topic – in this discussion – we had in mind was a programming-language independent solution. Use C# for one topic, Java in another topic and let Smalltalk be an equivalent partner here again.

Therefore I looked at various solutions (e.g. MessagePak-RPC) but then I found a very nice library: ZeroMQ (or “0MQ). This library has bindings (made by others) for lots of programming languages (even for GnuSmalltalk).

I decided to create a binding for VASmalltalk using the strenghts of VASmalltalk.

After having a binding for VA the first programs with interactions with C# were pretty easy to write – that offers VA a world to .NET languages, Java, Ruby and of course vice versa.

Then I remembered a sentence of Sebastian, that having a handler to Mongrel2 could offer a different way of interfacing VA to HTTP – on an equal level with other languages – and perhaps with a more speedier interface.

Then I needed to interface with components over WAN and native 0MQ is not that suitable for that and then I came back to Mongrel2. I sat down and wrote a handler for VA and Mongrel2. With a HTTP request (using SST) to Mongrel2 and then via 0MQ to an image behind Mongrel2 I was able to query my components in a safer way.

But having that I noticed, that Seaside is a must here and I gave all the sources to Sebastian and asked him if he could build an interface to use Seaside (and various techniques) over this handler. And yes, he made this work.

Now Seaside is responsing over Mongrel2 to requests. Sebastian created a new subclass of the SstAdapter stuff – but instead of using their own (VA-) IP socket interface ALL work is done by external threads in the 0MQ library, leaving VA more CPU time to do the more interesting work.

After that Sebastian decided to work on solutions to upload files to Seaside via this interface – and he is pretty sure to make it work and after that we enter the world of WebSockets and all that stuff.

After all we had two wonderful weeks with Mongrel2, 0MQ, VASmalltalk and Seaside and we are looking forward to make this software solution suitable and reliable for our projects (though devided by 8 timezones).

Sebastion will be at Smalltalk Solutions and you may ask him about this project in more details there. I will post updates here …

This entry was posted in Smalltalk and tagged , , . Bookmark the permalink.

One Response to VASmalltalk – Seaside in collaboration with 0MQ and Mongrel2

  1. Sebastian H. says:

    Yes indeed! This was fun. The file upload for WAFileLibraries is already working, but in VAST there´s additional logic in the SeasidePlattformLayer needed. The ENVY code repository checks for example application and version specific features which are not present in e.g. Pharo. This leads to unwanted popups in the VAST IDE.
    As far as I can say, this 0mq binding is really fun and with Mongrel2 as a web server configuring and starting a main node for distributed or seaside applications is simply too easy.
    Marten, before we have a look at websockets we shall get my Seaside EventSource sample working….
    SST isn´t bad at all, but 0mq makes inter smalltalk image processing and inter language communication much easier, too.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s