At the end of my recent post on building a cron service for your Zend Framework application, I mentioned a couple of weaknesses in the approach I took. Most notably, my cron service lacked any kind of locking mechanism to prevent cron runs from overlapping. When I wrote that, I was planning to add a service-level locking mechanism as described in Abhinav Singh’s blog last month; however, Greg’s comment on my post gave me a different idea.
Cron Tasks in Zend Framework Apps
Recently, in a fit of narcissism, I decided that my blog needed to be Twitter-aware; that is, I wanted all my posts to display automatically-generated lists of all Twitter tweets that reference them (via the backtweets.com API). Loading these backtweets is a bit resource-intensive, so I figured it’d be best to offload the work to a scheduled background task (e.g., a cron job). Since I figure I’ll be implementing more such tasks in the future, I took the opportunity to build out a simple cron task architecture that can handle any number of such jobs with relative ease. Here’s how it works.
Keeping Your Listeners in Order
A couple of days ago I blogged about how Doctrine’s SoftDelete behavior can keep other listeners’ preDelete() hooks from firing; after a bit of coding this morning, I believe I have a solution.
2009 in Review
It’s been an interesting year. I realize New Year’s has already come and gone, but I thought it’d be worth writing some last 2009ish thoughts anyway, just for posterity. Here are some of the things I remember most.
Know Thy Bottlenecks
One of my projects at work lately has been a searchable index of about 80,000 images, each involving about 20 fields’ worth of metadata. It’s a Drupal project, so it was pretty easy to set up the appropriate content types, fields, and so forth, but when it came time to set up searching, I made a few regrettable assumptions that cost me a lot of time.
When Is a DELETE Not a DELETE?
In my recent post on using Zend_Acl with Doctrine record listeners, I described a way to automate a Doctrine-based application’s access control logic based on certain event hooks in Doctrine’s record listener system. I still think it’s a fairly elegant approach, but as I’ve been working with it, I discovered one behavior I didn’t quite expect.
First Semester Jazz Arranging Recordings
Well, my first semester of jazz arranging at UNT is drawing to a close; it’s been a great experience, and I’m looking forward to doing some big band writing next semester. I feel like I’ve learned a heck of a lot, and gotten over some of the hurdles that usually get in my way when I want to write something. So that’s good, right?
Anyway, I thought I’d go ahead and post a couple of the better recordings; one of the nice things about studying at UNT is that there are plenty of musicians available that can read your charts down for you without any trouble. These recordings are mostly performed by my fellow class members; I haven’t listed them here, but if you’re one of them and you’d like me to list your name, just say so in the comments (and feel free to link to your own website as well).
I’m not terribly proud of my own playing on these, but that’s not what they’re for anyway …this is about the writing, and I think I did OK on that front. Here goes:
Sax Soli for Joy Spring Circular (original composition) The More I See You
Using Zend_Acl With Doctrine Record Listeners
Zend_Acl is a very powerful tool to help manage access control logic, but it can be a bit difficult to determine exactly where and how to use it.
Takeaways From the One O’Clock Fall Concert
Tonight Jamie and I went to see the One O’Clock Lab Band’s fall concert, with guest artist John Mosca, trombonist and co-leader of the Village Vanguard jazz orchestra. I don’t think I’d been to a One O’Clock concert since I graduated a few years back, which is odd given how much I like jazz, and how close we’ve lived to UNT this whole time. But no matter; it was an excellent concert, and I hope to keep going back.
It did put some things in perspective as far as my playing goes—if tonight’s trombone section is any indicator, I probably shouldn’t have ever been in the band myself. Don’t get me wrong, I can play the trombone…but I think I was never quite disciplined enough to play as cleanly and effectively as these guys did.
Since I am taking jazz classes again, I’m hoping to improve; once I get started with lessons and ensemble playing again I’m sure some of it will come back to me…but not without a good bit more shedding than I did last time around. Here’s hoping for a better sense of discipline in the semesters to come.
Building a New Blog
Although I’ve loved using Wordpress for the duration of this blog, recently I’ve been working on a custom replacement blog platform that I can host and maintain myself. This probably sounds odd, especially since there are already so many excellent blogging platforms available, but I’ve pushed ahead with it for a couple of reasons I think most developers will understand:
- Here at wordpress.com, I’d have to pay for certain features I can get for free with a self-hosted solution; I’d rather pay for hosting than pay for, say, custom templating.
- Although I could run Wordpress or Drupal on a self-hosted domain, I still wouldn’t really be in control of the platform; a tailor-made solution will do exactly what I want it to, no more, no less.
- Most importantly: I blog primarily on my free time, mainly about projects I’m doing to hone skills I don’t typically get to use during my day job. I use Drupal all day at work, so using it for my blog wouldn’t really teach me anything.
The new platform is based on my favorite open source framework, Zend Framework, and makes heavy use of the Doctrine ORM library; I’ve been using Zend Framework for several years now, but Doctrine is new to me (and fantastic, by the way) …so I’m learning some very helpful new skills, and that makes me happy.
If you’d like to take a look at the new blog, it’s actually already live at jazzslider.org; I still haven’t worked out all the kinks, especially as far as IE compatibility is concerned, but I believe it’s a step in the right direction.
Check it out and let me know what you think!