<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kumar Abhijeet on Medium]]></title>
        <description><![CDATA[Stories by Kumar Abhijeet on Medium]]></description>
        <link>https://medium.com/@kumarabhijeet1202?source=rss-bb9608ed230f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*n-sZdTbxcaF9Buj469HamQ.png</url>
            <title>Stories by Kumar Abhijeet on Medium</title>
            <link>https://medium.com/@kumarabhijeet1202?source=rss-bb9608ed230f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 22:19:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kumarabhijeet1202/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How We Use Sidekiq to Process Background Jobs]]></title>
            <link>https://medium.com/gojekengineering/how-we-use-sidekiq-to-process-background-jobs-80fa0e926a13?source=rss-bb9608ed230f------2</link>
            <guid isPermaLink="false">https://medium.com/p/80fa0e926a13</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[redis]]></category>
            <category><![CDATA[how-to]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[sidekiq]]></category>
            <dc:creator><![CDATA[Kumar Abhijeet]]></dc:creator>
            <pubDate>Fri, 27 Mar 2020 04:12:13 GMT</pubDate>
            <atom:updated>2020-03-27T04:12:13.325Z</atom:updated>
            <content:encoded><![CDATA[<h4>Learn how to set up an asynchronous job execution system.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZBguX5HCtewiL0uMRK-kZg.jpeg" /><figcaption><a href="https://bit.ly/3bvBTCA">gojek.jobs</a></figcaption></figure><p>At Gojek, a lot of our teams use Ruby on Rails to develop a plethora of applications. While building an application, we often need some jobs to be performed asynchronously. Stuff like processing a chunk of data, performing batch executions, or even sending an email.</p><p>Congruent to team management, where we delegate some of our jobs to increase the team’s efficiency, we figured we needed an asynchronous job framework for our application to process jobs in the background to sustain the desired efficiency.</p><h3>But why do we need an async job system? 🤔</h3><p>In a user-facing system, when the user runs a command or a service, the system should acknowledge the success of the operation, although some critical and time-intensive jobs are still executing in the background.</p><p>This use case is solved by an async job execution system, where we can enqueue the jobs to be executed at a later time, and get a heads up when they are executed, while the user-facing system keeps operating smoothly.</p><p>It should also allow a large batch of jobs to be scheduled and executed with retries to make the system more reliable and resilient.</p><h3><em>Enter Sidekiq</em></h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Ftenor.com%2Fembed%2F12127069&amp;display_name=Tenor&amp;url=https%3A%2F%2Ftenor.com%2Fview%2Fchuck-norris-kicked-angry-kick-side-kick-gif-12127069&amp;image=https%3A%2F%2Fmedia.tenor.com%2Fimages%2F1ba8089fe841b878995c2e2224ce4bbe%2Ftenor.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=tenor" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/697207060c7020182f40c5d1a0b09167/href">https://medium.com/media/697207060c7020182f40c5d1a0b09167/href</a></iframe><p><em>Um, no… Not that sidekick.</em></p><p>Sidekiq is an open-source framework that provides efficient background processing for Ruby applications. It uses <a href="https://en.wikipedia.org/wiki/Redis">Redis</a> as an in-memory data structure to store all of its job and operational data. It’s important to be aware that Sidekiq by default doesn’t do scheduling, it only executes jobs. We can use job scheduling frameworks like<strong> Resque</strong>, which is also based on Redis.</p><p>It provides features to execute any job asynchronously or to be scheduled for later execution, by enqueuing them in a background job queue. It also offers explicit retry strategies in case of a failed execution. Hence, it perfectly fulfils our use case. 🤠</p><h3>How we use Sidekiq?</h3><p>Being a part of the Lambda ecosystem, we provide a Heroku-like PAAS framework for our developers to quickly create and deploy units of logic, and therefore, the platform needs to perform a great profusion of jobs like provisioning infrastructure, creation and deletion of tags, DNS, etc.</p><p>Hence, for our platform to work seamlessly, we use Sidekiq to push these jobs to the background and perform asynchronously. You can read more about Lambda in this post. 👇</p><p><a href="https://blog.gojekengineering.com/a-tale-of-two-lambdas-solving-event-sourcing-at-go-jek-149884d898a1">A tale of two Lambdas - Solving Event Sourcing at GO-JEK</a></p><h3>Okay, let’s get our hands dirty 💪</h3><p>We first need to setup Redis before using Sidekiq.</p><pre>brew install redis<br>redis-server</pre><p>Let’s add Sidekiq to the Gemfile</p><pre>gem &#39;sidekiq&#39;</pre><p>Run bundle to install sidekiq</p><pre>bundle</pre><p>For Sidekiq to work with Rails’ jobs API, we need to tell Rails to use Sidekiq as the queue_adapter; add the below line to <em>config/application.rb</em></p><pre>config.active_job.queue_adapter = :sidekiq</pre><p>Now, we are done with the setup. <strong>Let’s roll. </strong>😎</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FiKBAAfYNDu1dowhnEj%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FiKBAAfYNDu1dowhnEj%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FiKBAAfYNDu1dowhnEj%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="326" frameborder="0" scrolling="no"><a href="https://medium.com/media/ea0f9b53a401965d3a5671e0235cc55b/href">https://medium.com/media/ea0f9b53a401965d3a5671e0235cc55b/href</a></iframe><p>Let’s create a simple job which sends an email, and uses Active Job, which is a standard interface for interacting with job runners.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3e701951fc70baa00d089d34afff76ef/href">https://medium.com/media/3e701951fc70baa00d089d34afff76ef/href</a></iframe><pre>SendEmailJob.<strong>perform_async</strong>(body, email)</pre><p>The job can be called wherever required and will be pushed to a background queue and performed asynchronously.</p><h3>Let’s write some tests <a href="https://emojipedia.org/test-tube/">🧪</a></h3><blockquote>Test-Driven Development is one of the Gojek’s core Tech principles, and we emphasise writing specs first.</blockquote><p>We are going to use <em>RSpec</em> as the testing framework, and <em>rspec-sidekiq</em> gem for testing Sidekiq jobs as it provides a collection of matchers and helpers.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/993a832b1af9049480bc480f60a3555e/href">https://medium.com/media/993a832b1af9049480bc480f60a3555e/href</a></iframe><p>Here, we have written specs for ensuring whether the job has enqueued to the correct queue and it calls the perform method correctly.</p><p>Some tips to remember while testing Sidekiq jobs:</p><ol><li>Sidekiq does not make any changes to Redis while testing, hence manipulating with the queue and jobs is not possible.</li><li>Make use of <em>test doubles</em> in RSpec to mock the queue and jobs, allow required behaviour, and then set expectations.</li><li>Jobs triggered with perform_later with a set wait<em> </em>time will be pushed to ScheduledSet. Hence upon enqueuing, will wait for other jobs to finish.</li><li>Make use of the Sidekiq dashboard, which gives monitoring information and is quite useful while debugging.</li></ol><p>That’s all from us. Hopefully this post helped you understand how Sidekiq can be used to your advantage. Thanks for reading! 💚</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IPWwoozDxeKoXMtXEyrtLw.png" /></figure><p>Liked what you read? We can send our posts straight to your inbox. <a href="https://mailchi.mp/go-jek/gojek-tech-newsletter">Sign up for our newsletter!</a></p><figure><a href="https://bit.ly/3bvBTCA"><img alt="Gojek Open Positions" src="https://cdn-images-1.medium.com/max/803/1*O1Jdh3NHEKONzU8Yt4Z82w.jpeg" /></a><figcaption>gojek.jobs</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=80fa0e926a13" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gojekengineering/how-we-use-sidekiq-to-process-background-jobs-80fa0e926a13">How We Use Sidekiq to Process Background Jobs</a> was originally published in <a href="https://medium.com/gojekengineering">Gojek Product + Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to reinvent yourself in 2020]]></title>
            <link>https://medium.com/@kumarabhijeet1202/how-to-reinvent-yourself-in-2020-1cb0917a8a6a?source=rss-bb9608ed230f------2</link>
            <guid isPermaLink="false">https://medium.com/p/1cb0917a8a6a</guid>
            <category><![CDATA[new-year-resolution]]></category>
            <category><![CDATA[habits]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[2020]]></category>
            <dc:creator><![CDATA[Kumar Abhijeet]]></dc:creator>
            <pubDate>Tue, 31 Dec 2019 11:49:24 GMT</pubDate>
            <atom:updated>2020-01-01T04:01:06.104Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Reinvent yourself in 2020</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*T49-afPJJGvwO4J6" /><figcaption>Photo by <a href="https://unsplash.com/@jamie452?utm_source=medium&amp;utm_medium=referral">Jamie Street</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Today is the last day of the year and the decade too. Most of us would have prepared a considerate list of new year resolutions, e.g., like, I will workout 5 days a week, I will quit alcohol, I will start saving money and so on.</p><p>But new year resolutions are nothing but a high, they give us a psychological sense of a fresh start, but in reality, it’s just a change in date of the calendar. This explains why gyms are crowded with new registrations in January but 70% of them don’t even stick to it till February.</p><blockquote><em>New year, new me is complete bullshit, you can’t make and stick to new habits in just one day.</em></blockquote><p>It’s better to start the process of building habits, but I have seen people doing everything at once, and that becomes overwhelming after a week. Daniel Kahnemann in his book, “<a href="https://www.goodreads.com/book/show/11468377-thinking-fast-and-slow">Thinking, fast and slow</a>” discusses the idea of ego depletion. Ego depletion happens when people use up their available willpower on one task. As a result, they are unable to exert the same level of self-control on subsequent, often unrelated tasks, which makes it harder to stick with multiple new habits.</p><p>So, it’s better to start small and inculcate habits over the year. Take it one at a time and experiment with it, if it works for you, stick with it. I will share some of the ideas for new habits here :</p><h3>1. Reading</h3><blockquote>“A reader lives a thousand lives before he dies . . . The man who never reads lives only one.” — George R.R. Martin</blockquote><p>Be it fiction or non-fiction, start reading. Start small, maybe just 5 pages a day, and be consistent. It will still be a lot more than not reading at all. I suggest starting with classic fiction, and then divert to your interests, be it, fantasy, psychology, philosophy, biographies,etc. Reading broadens our horizon and provides the ability to view a situation from multiple perspectives.</p><p>If you want to start your reading journey, start <a href="https://www.amazon.com/b?ie=UTF8&amp;node=8192263011">here</a>. Order a book of the genre you like and start reading.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*13VnBvTEjVdIWNiv" /><figcaption>Photo by <a href="https://unsplash.com/@roadtripwithraj?utm_source=medium&amp;utm_medium=referral">Road Trip with Raj</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>2. Stop saving, start investing</h3><p>It’s a common notion with Millenials to save money as soon as they start earning. But imagine, you want to save 50 lakh rupees (around $70k), to buy a house. How many years will it take to reach that goal just by saving from your paycheck after cutting taxes? You do the math. And the interests you earn on the savings will also be taxed. It’s a lose-lose situation.</p><p>It’s better to invest time to develop your financial aptitude, learn the market and the law, and build your assets rather than pouring all resources in the liabilities and see the money flying out of your pocket. Start with books like <a href="https://www.goodreads.com/en/book/show/39924789">Rich Dad Poor Dad</a> and <a href="https://www.goodreads.com/book/show/106835.The_Intelligent_Investor">The Intelligent Investor</a>.</p><h3>3. Planning and organizing</h3><blockquote>“Always plan ahead, it wasn’t raining when Noah build the Ark.” — Richard Cushing</blockquote><p>Whatever might be your field of work, it’s evident that if you don’t plan the intricacies and phases of your action, it is bound to fail. Plan and map out your approach, then start acting.</p><p>The working environment directly impacts our productivity, hence having a minimalistic and structured workplace is important. But multiple apps like Evernote, Todoist, Trello, etc have to be used in unison to achieve a fully functional system. Last month, I discovered Notion, an all-in-one workspace that captures all the functionalities of the above apps. Check out the app <a href="https://www.notion.so/?r=7c7d3a31c4f74750ba15377ae79c904c">here.</a> And refer the below video as a manual.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fm9S5I3pWz94%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dm9S5I3pWz94&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fm9S5I3pWz94%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/70fd428bef20d382f0f052dad2296053/href">https://medium.com/media/70fd428bef20d382f0f052dad2296053/href</a></iframe><h3>4. Social Media Detox</h3><p><strong>Globally, more than 264 million people of all ages suffer from depression and anxiety disorders.</strong></p><p>And what’s one of the main reasons behind it, the evolution of technology, specifically social media.</p><blockquote>The short-term, dopamine-driven feedback loops that we have created are destroying how society works. Platforms like Facebook, Snapchat, and Instagram leverage the very same neural circuitry used by slot machines and cocaine to keep us using their products as much as possible.</blockquote><p>Taken from a <a href="http://sitn.hms.harvard.edu/flash/2018/dopamine-smartphones-battle-time/">study</a> by Harvard University on the behavior of smartphones on an average mind.</p><p>Hence, try a social media detox for at least a week. Uninstall all social media apps, disable the accounts and install a minimalistic theme ( like Before Launcher for Android ), disable all notifications and keep your phone on flight mode whilst working. If you feel even a little bit of improvement in your mood, stick with the habit.</p><h3>5. Journalling</h3><p>Ah the good old days, when we used to maintain scrapbooks covered with diaries and personal memories, we were kids then. Now, we don’t do that anymore, as it’s considered old-fashioned. But it’s something you need to do — <em>now</em>. Yep, it’s true. Journaling does more than just help you record your memories or find self-expression. It’s good for your health.</p><p>Just writing a bunch of thoughts at the end of the day, seems vanilla. But writing your goals, thoughts, and feelings every day in a piece of paper can help you move on with the day, and become ready for the next one. It helps you release stress and boosts your mood.</p><p>Maintain a bullet journal for productivity and mindfulness, it will help you keep track of your daily goals and events and reflect.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Ffm15cmYU0IM%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dfm15cmYU0IM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Ffm15cmYU0IM%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/98540490d6edf652f524c1d465f8d525/href">https://medium.com/media/98540490d6edf652f524c1d465f8d525/href</a></iframe><p>I just wrote five of my ideas, but the list is quite long. Some of those like, mindful eating, regular body movement, writing daily, learn an instrument, etc. <br>But it all boils down to the question that “ Do YOU wanna do it ? “. It’s simple.</p><p>Happy Holidays. 🌌</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1cb0917a8a6a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>