Posts
Type Providers - Tutorial Part 1 - Concepts
I’ve only been working with the F# language for the last year. Which means that all of my learning has been with version 3.x of the F# language. One of the biggest features of 3.x, and something which I have yet to work with, is the Type Provider. Type Providers dynamically generate new types, usually from some data source (e.g. databases, XML documents, web services), which a developer can use in their code.
Posts
First Haskell Meetup
Last night was the first meet up for the San Diego Haskell Users Group. I have to say that it was a lot of fun and probably the most interesting dev meet up I’ve been to so far in San Diego. I have barely done any Haskell, beyond get the compiler setup on my computer and make “Hello, World”. As such, I learned a lot.
I reallly love how Haskell allows you to build “pipelines of data”: when you chain together several functions, put data into the top function and get the output of the bottom.
Posts
RavenDB, MapReduce, and Logging
Working with a system which is distributed and uses messaging for communication presents some interesting challenges. One frequent challenge I’ve gotten to deal with a few times is: how to tell what’s happening to a request as the system is processing it. A request comes into the my system, which wakes one service up and it does some work, then it sends off commands to two other services which both do some work, and then, when both are done, a final service does some work and completes the task.
Posts
RabbitMQ and F# - Part 6
A final round of polish. Now that I have the layout and flow for using my RabbitMQ library defined, it’s time to go through and do a bit of clean up on my names. There’s a lot I can do to make it so that code you write with this library becomes as readable and literate as possible.
Here’s the code you write to do the initial setup:
let connection = openConnection "localhost" let myChannel = openChannel connection If I just look at this, I have to ask: open connection to what?
Posts
RabbitMQ and F# - Part 5
Alright, I now have a simple usable RabbitMQ client library which fits comfortably with F#. However, there’s still some inconsistency in the design which I want to polish out:
To create a consumer on a queue, you call: createQueueConsumer myChannel "myQueue" To create a read function for a queue, you call: let (readFrom,_) = createQueueFuntions myChannel let readFromMyQueue = readFrom "myQueue" To create a write function for a queue, you call: let (_,writeTo) = createQueueFuntions myChannel let writeToMyQueue = writeTo "myQueue" Why have a function which manages both the read AND the writes for a channel?
Posts
RabbitMQ and F# - Part 4
In my previous post, I made my RabbitMQ client library a bit more functional by removing the Queue record type and replacing it with higher order functions. These higher order functions are used for creating functions for reading/writing queues. If you want to use “MyQueue” for writing, you use the “writeTo” higher order function to create a function for writing to “MyQueue”. It’s sounds more complex than it really is.
Posts
RabbitMQ and F# - Part 3
I now have a functioning RabbitMQ Library! Though, there is a lot more to be done to make it satisfactory.
There are two problems:
Missing the Queue Consumer functionality. This makes it a lot easier to deal with RabbitMQ so I definitely want to get this in. I’m not happy with using the record type to capture the Read and Publish functions for a queue. After all, how often are you going to be writing to and reading from a specific queue in the same process?
Posts
RabbitMQ and F# - Part 2
Notes about RabbitMQ: - You should have one connection per application and one channel per thread (http://stackoverflow.com/a/10501593)
I was able to build and run my sender and receiver, both using my client.
However, something odd happened. The receiver was only printing out every other message which the Sender sent.
Here’s the secret of what’s happening:
OH SNAP! There are two consumers on the queue and RabbitMQ is splitting the messages evenly between the two consumers.
Posts
Odin Prototype
In my previous post, I described a distributed monitoring system called Odin. Which I am building because it will help me learn and explore topics in distributed computing independent of work.
I’ve been slowly working on it when I get a chance and have put together a very basic prototype: https://github.com/erichgess/OdinPrototype
This prototype is some hacking I did over a few, very spread out days, to try out some concepts. It has a very simple agent, which reads %CPU used and sends a message to a receiver.
Posts
Odin - Learning Distributed Computing
Over the last two years, I’ve really become interested in distributed computing and things like big data. My interest in these topics grew in coincidence with my falling in love with F#. I do a lot of different projects at work and not all of them involve any of those three topics. So, to provide a motive for learning more about distributed computing and sharpening my F# skills I have decided to start working on a small side project (currently, by myself but several friends are interested).