Stay current on JavaScript, Node, and Front-End development. Learn from experts in programming, careers, and technology every week. Become a supporter of this podcast: https://www.spreaker.com/podcast/javascript-jabber--6102064/support.
…
continue reading
محتوای ارائه شده توسط Christoph Neumann and Nate Jones, Christoph Neumann, and Nate Jones. تمام محتوای پادکست شامل قسمتها، گرافیکها و توضیحات پادکست مستقیماً توسط Christoph Neumann and Nate Jones, Christoph Neumann, and Nate Jones یا شریک پلتفرم پادکست آنها آپلود و ارائه میشوند. اگر فکر میکنید شخصی بدون اجازه شما از اثر دارای حق نسخهبرداری شما استفاده میکند، میتوانید روندی که در اینجا شرح داده شده است را دنبال کنید.https://fa.player.fm/legal
Player FM - برنامه پادکست
با برنامه Player FM !
با برنامه Player FM !
Episode 008: Twitter, Plated
Manage episode 223805751 series 2463849
محتوای ارائه شده توسط Christoph Neumann and Nate Jones, Christoph Neumann, and Nate Jones. تمام محتوای پادکست شامل قسمتها، گرافیکها و توضیحات پادکست مستقیماً توسط Christoph Neumann and Nate Jones, Christoph Neumann, and Nate Jones یا شریک پلتفرم پادکست آنها آپلود و ارائه میشوند. اگر فکر میکنید شخصی بدون اجازه شما از اثر دارای حق نسخهبرداری شما استفاده میکند، میتوانید روندی که در اینجا شرح داده شده است را دنبال کنید.https://fa.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
searchfunction return[updated-handle, result]. searchcan catch an auth exception, retry, and return a new auth handle.- Instead of
searchretrying, the fetcher can do it! Then it works for all kinds of requests. - Better yet, leave fetch simple, and have a
fetch-with-retryfunction that usesfetch. - Can have even more policy functions like,
fetch-with-retry-forever. - "Keep calm, and
assocon." - "I'm never going to miss another Clojure tweet. I'm going to read them all!"
Clojure in this episode:
loop,recurtry,catchatomassoc
118 قسمت
Manage episode 223805751 series 2463849
محتوای ارائه شده توسط Christoph Neumann and Nate Jones, Christoph Neumann, and Nate Jones. تمام محتوای پادکست شامل قسمتها، گرافیکها و توضیحات پادکست مستقیماً توسط Christoph Neumann and Nate Jones, Christoph Neumann, and Nate Jones یا شریک پلتفرم پادکست آنها آپلود و ارائه میشوند. اگر فکر میکنید شخصی بدون اجازه شما از اثر دارای حق نسخهبرداری شما استفاده میکند، میتوانید روندی که در اینجا شرح داده شده است را دنبال کنید.https://fa.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
searchfunction return[updated-handle, result]. searchcan catch an auth exception, retry, and return a new auth handle.- Instead of
searchretrying, the fetcher can do it! Then it works for all kinds of requests. - Better yet, leave fetch simple, and have a
fetch-with-retryfunction that usesfetch. - Can have even more policy functions like,
fetch-with-retry-forever. - "Keep calm, and
assocon." - "I'm never going to miss another Clojure tweet. I'm going to read them all!"
Clojure in this episode:
loop,recurtry,catchatomassoc
118 قسمت
همه قسمت ها
×به Player FM خوش آمدید!
Player FM در سراسر وب را برای یافتن پادکست های با کیفیت اسکن می کند تا همین الان لذت ببرید. این بهترین برنامه ی پادکست است که در اندروید، آیفون و وب کار می کند. ثبت نام کنید تا اشتراک های شما در بین دستگاه های مختلف همگام سازی شود.