|A suite of examples showcasing the power|
of webhooks using Iron.io and SendGrid.
We believe that more and more applications will be built not using static servers and direct integrations, but instead using workers that come into existence when you need them and shut down when they’re no longer necessary.
We believe the future will be built on webhooks and callbacks, an evented model that creates loose, flexible architectures.
Using Webhooks TodaySo many of the most popular cloud APIs are using webhooks to enable this loose communication paradigm, that future isn’t far away. That’s why we built webhook endpoints into IronWorker, so you can spin up a worker using the webhooks that have become the lingua franca of the web. That’s why we built webhook endpoints into IronMQ, so you can create a message on a queue using nothing but a webhook, without writing a single line of code.
That’s why we’re so excited that SendGrid offers their Inbound Parse API, which lets you turn emails into webhooks. This kind of interaction is the future of service-oriented architectures, and we’re really excited that so many APIs are supporting it already. It ushers in a new era of cloud applications. EC2 and other hosts require you to set up endpoints to receive webhooks, and there’s so much overhead involved, it’s a major process to connect two APIs. SES and similar solutions don’t offer a way to receive email, which means you need to set up an email server to process those emails, you need to worry about its uptime, and you need to scale it to match your volume of emails. It’s super hard to go from someone sending you an email to being able to programmatically access that email. SendGrid’s Inbound Parse API and their embracing of webhooks allows you to enable that interaction in the amount of time it takes your DNS to resolve.
Introducing GridIron, A Reference Example For Webhook IntegrationsAt one of the hackathons we ran into SendGrid at, we started talking about all the awesome ways that Iron.io and SendGrid can be used together. As we talked more and more about it, we thought it would be a good idea to share this information with our customers, to help them get the most out of the web.
So today we’re introducing GridIron, a set of examples that shows off the power of SendGrid and Iron.io when used in concert. Consider it a case study of how to use webhooks to make powerful interactions with very little code.
GridIron consists of five main examples right now:
- Hello, SendGrid: a simple demonstration of using IronWorker to send emails using SendGrid
- Queue-Based Emailing: an evolution of Hello, SendGrid that uses a pull queue to give you a more scalable, robust email sending solution that gives you full control over how quickly emails are sent out.
- Fanout: an example that shows how to use IronMQ’s push queues to fan out data to multiple processors. In this case, two IronWorker workers receive the data, and they send a text message through Twilio and send an email through SendGrid.
- Github Notifications: an example that shows how to use Github’s webhooks to trigger IronWorker workers. The workers send emails to the repo owner whenever specified branches are committed to, and ignores the other notifications.
- Markov Bot: the most powerful demonstration we could think of, the Markov Bot will accept an email from the Inbound Parse API, use it to queue up a worker, and process that email. The bot will read your first line, and try to guess the next word you’d use, just like your phone does. It then emails back your line, with its guess appended to the end. It’s an email bot that was written in about 200 lines of Python.
Fork GridIron on Github. As always, feel free to stop by our chatroom for help!