I hit a whole slew of errors, since I haven’t touched Go in a while and normally keep myself in the CLI world. I had some fun trying to parse form bodies. This post was excellent: http://blog.renzuocheng.com/2012/11/go-lang-http-invalid-read-on-closed-request-body/
I was getting annoyed with re-building the file after every save, so I hacked together a terrible inotify line:
inotifywait -e close_write -m youtube-gif-go.go | while read line; do pkill -QUIT -f ‘go run’; pkill -f ‘/tmp/go-build’; go run youtube-gif-go.go & date 2>&1; done
I decided to throw Redis at this project too. Even though it’s just a toy project and the filesystem would work fine, it seemed like a good idea to get it under my belt. I got a very basic pubsub-powered model working yesterday. I’m working on the API first and plan on making the website a consumer of the API. Right now, after POSTing to /gifs:
- It’ll return HTTP 202 (Accepted)
- Throw the URL into Redis
- Publish the URL and ID serialized into JSON over the “download-queue” channel
- A separate Go script waiting on events on that channel begins work on downloading it
- When finished, resends info to the “chop-queue” channel. The same process continues for the “stitch-queue” channel
Splitting up the processes means I could potentially move each of these processes to different machines that had better specs to deal with their process. I have a lot to do and probably won’t be able to present anything tonight.
I bought an adorable notebook from Muji that I’ve been keeping notes in. I started writing down some information about fuse-colors, after spending some time talking with Jessie Luehrs and Tom Ballinger about ideas for it, including some PTY trickery that I now need to include in the pro/con list.
This post is going all over the place time-wise. Last night I went to a meetup about Apache Spark with Nicholas Chammas, Waldemar Salinas, and Rob Moore. It was at Bloomberg, which is an incredibly nice building. The talk was great, and I plan on pairing with Nicholas to learn more.