Artwork

Content provided by Christoph Neumann and Nate Jones, Christoph Neumann, and Nate Jones. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by Christoph Neumann and Nate Jones, Christoph Neumann, and Nate Jones or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://player.fm/legal.
Player FM - Podcast App
Go offline with the Player FM app!

Episode 008: Twitter, Plated

23:07
 
Share
 

Manage episode 223805751 series 2463849
Content provided by Christoph Neumann and Nate Jones, Christoph Neumann, and Nate Jones. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by Christoph Neumann and Nate Jones, Christoph Neumann, and Nate Jones or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://player.fm/legal.

Christoph tries to figure out why Twitter stopped talking about Clojure.

  • "Are you twitterpated?"
  • Building on where we left off last episode.
  • Runs and just stops working.
  • "I was pretty sure it stopped working because people on Twitter just stopped talking about Clojure. After about a day of that, I realized people were talking about Clojure, and I just wasn't seeing it."
  • The auth token expired! What should we do?
  • Why should the main loop have to deal with getting a new auth token?
  • "The Twitter wrapper should be concerned with all of the warts and complexities of dealing with Twitter."
  • "What problems should bubble up, and which ones shouldn't?"
  • The wrapper should handle the retry.
  • It's like a kitchen in a restaurant. What are the steps of fulfilling an order? The customer doesn't care.
  • "There's a side-effect: the freezer mutates."
  • The wrapper gets to worry about all the steps:
    • turning the order into the specific request for the kitchen
    • do the I/O to fetch and fulfill the request
    • the "input transform" takes the mass of data and picks out the relevant parts
    • the "internal" version is returned
  • "Like all good metaphors, they stretch to the point where they break, like a rubber band."
  • Maybe avoid expired tokens by authenticating every time? Too much overhead.
  • If the handle is mutable, then retry can just update the handle with the new token.
  • A mutable handle does allow the wrapper to control the concern.
  • The "handle" is the state of the wrapper. The term "handle" comes from I/O libraries.
  • Instead of mutation, have the search function return [updated-handle, result].
  • search can catch an auth exception, retry, and return a new auth handle.
  • Instead of search retrying, the fetcher can do it! Then it works for all kinds of requests.
  • Better yet, leave fetch simple, and have a fetch-with-retry function that uses fetch.
  • Can have even more policy functions like, fetch-with-retry-forever.
  • "Keep calm, and assoc on."
  • "I'm never going to miss another Clojure tweet. I'm going to read them all!"

Clojure in this episode:

  • loop, recur
  • try, catch
  • atom
  • assoc
  continue reading

118 episodes

Artwork
iconShare
 
Manage episode 223805751 series 2463849
Content provided by Christoph Neumann and Nate Jones, Christoph Neumann, and Nate Jones. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by Christoph Neumann and Nate Jones, Christoph Neumann, and Nate Jones or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://player.fm/legal.

Christoph tries to figure out why Twitter stopped talking about Clojure.

  • "Are you twitterpated?"
  • Building on where we left off last episode.
  • Runs and just stops working.
  • "I was pretty sure it stopped working because people on Twitter just stopped talking about Clojure. After about a day of that, I realized people were talking about Clojure, and I just wasn't seeing it."
  • The auth token expired! What should we do?
  • Why should the main loop have to deal with getting a new auth token?
  • "The Twitter wrapper should be concerned with all of the warts and complexities of dealing with Twitter."
  • "What problems should bubble up, and which ones shouldn't?"
  • The wrapper should handle the retry.
  • It's like a kitchen in a restaurant. What are the steps of fulfilling an order? The customer doesn't care.
  • "There's a side-effect: the freezer mutates."
  • The wrapper gets to worry about all the steps:
    • turning the order into the specific request for the kitchen
    • do the I/O to fetch and fulfill the request
    • the "input transform" takes the mass of data and picks out the relevant parts
    • the "internal" version is returned
  • "Like all good metaphors, they stretch to the point where they break, like a rubber band."
  • Maybe avoid expired tokens by authenticating every time? Too much overhead.
  • If the handle is mutable, then retry can just update the handle with the new token.
  • A mutable handle does allow the wrapper to control the concern.
  • The "handle" is the state of the wrapper. The term "handle" comes from I/O libraries.
  • Instead of mutation, have the search function return [updated-handle, result].
  • search can catch an auth exception, retry, and return a new auth handle.
  • Instead of search retrying, the fetcher can do it! Then it works for all kinds of requests.
  • Better yet, leave fetch simple, and have a fetch-with-retry function that uses fetch.
  • Can have even more policy functions like, fetch-with-retry-forever.
  • "Keep calm, and assoc on."
  • "I'm never going to miss another Clojure tweet. I'm going to read them all!"

Clojure in this episode:

  • loop, recur
  • try, catch
  • atom
  • assoc
  continue reading

118 episodes

All episodes

×
 
Loading …

Welcome to Player FM!

Player FM is scanning the web for high-quality podcasts for you to enjoy right now. It's the best podcast app and works on Android, iPhone, and the web. Signup to sync subscriptions across devices.

 

Quick Reference Guide