Everyone wants an alternative to email, but do we really need one?
Editor’s note: this post originally appeared on Medium; it is republished here with permission.
Conventional workplace wisdom declares email a daily scourge. We receive too much of it. We spend too much time replying to it. We concoct elaborate strategies to cope with it and avoid incurring a debt that downward-spirals to email bankruptcy.
We bow down at the altar of Inbox Zero, the methodology that dictates we take prompt, concrete action to dispatch with every single message we receive. Reply to it. Or file it. Or delete it. We turn the drudgery of processing the flood of correspondence into a game. Inbox Zero, FTW! Achievement unlocked … till the next time we hit refresh. Because emails are like gray hairs: for every one we send packing, five more will soon arrive in its place. Any client-side strategy we take to conquer our inboxes is thus limited by the fact that it’s palliative, not ameliorative. Perpetuating Inbox Zero means living in a constant state of vigilance, aggressively and swiftly responding to every incoming message. It means becoming an email answering machine!
Learn to build event-driven client and server applications
I want to build a web server, a mail server, a BitTorrent client, a DNS server, or an IRC bot—clients and servers for a custom protocol in Python. And I want them to be cross-platform, RFC-compliant, testable, and deployable in a standardized fashion. What library should I use?
Twisted is a “batteries included” networking engine for writing, testing, and deploying event-driven clients and servers in Python. It comes with off-the-shelf support for popular networking protocols like HTTP, IMAP, IRC, SMTP, POP3, IMAP, DNS, FTP, and more.
To see just how easy it is to write networking services using Twisted, let’s run and discuss a simple Twisted TCP echo server:
from twisted.internet import protocol, reactor
def dataReceived(self, data):
def buildProtocol(self, addr):
With Twisted installed, if we save this code to echoserver.py and run it with python echoserver.py, clients can now connect to the service on port 8000, send it data, and get back their echoed results. Read more…