How To Design A Reliable Distributed Timer

1 Preface I have been maintained a legacy distributed timer for months for my employer, then some important pay business are leveraging on it, with 1 billion tasks handled every day and 20k tasks added per second at most. Even though it’s old and full of black magic code, but it also also have insighted and well-designed code. Based on this old, running timer, I summarize and extract as this article, and it wont include any running code(perhaps pseudocode, and a lot of figures, as an adage says: A picture is worth a thousand words)....

August 5, 2021 · 9 min · 1845 words · Ramsay Leung

Let's make everything iterable

Iterate through pagination in the Rest API 1 Preface About 4 months ago, icewind1991 created an exciting PR that adding Stream/Iterator based versions of methods with paginated results, which makes enpoints in Rspotify more much ergonomic to use, and Mario completed this PR. In order to know what this PR brought to us, we have to go back to the orignal story, the paginated results in Spotify’s Rest API. 2 Orignal Story Taking the artist_albums as example, it gets Spotify catalog information about an artist’s albums....

April 29, 2021 · 5 min · 1004 words · Ramsay Leung

Serde Tricks

The lesson learned from refactoring rspotify 1 Preface Recently, I and Mario are working on refactoring rspotify, trying to improve performance, documentation, error-handling, data model and reduce compile time, to make it easier to use. (For those who has never heard about rspotify, it is a Spotify HTTP SDK implemented in Rust). I am partly focusing on polishing the data model, based on the issue created by Koxiaet. Since rspotify is API client for Spotify, it has to handle the request and response from Spotify HTTP API....

December 13, 2020 · 10 min · 2007 words · Ramsay Leung

rspotify has come to async/await

1 Preface Today, I am exited to introduce you the v0.9 release I have been continued to work on it for the past few weeks that adds async/await support now! 2 The road to async/await What is rspotify: > For those who has never heared about rspotify before, rspotify is a Spotify web Api wrapper implemented in Rust. With async/await’s forthcoming stabilization and reqwest adds async/await support now, I think it’s time to let rspotify leverage power from async/await....

February 28, 2020 · 3 min · 432 words · Ramsay Leung