Introduction go-kit is one of the most complete and flexible toolkits for developing microservices in Go language. At the same time, the learning curve of go-kit is steep. In this post, I’m trying to explain go-kit fundamental components using general purpose client-server model of Linux. General Purpose Client-Server Architecture A server in Linux binds & … More Simplifying go-kit toolkit for Microservices – Part I
Not an absolutely bad idea, but you need a careful understanding before using sync Pool. Golang sync Pool is used to create a self-managed object pool, with just New/Get/Set functions. The Pool implementation uses a mutex based locking for thread-safe operations from multiple Go routines. Design Principles Golang sync. Pool use garbage collection to manage … More Why Using Golang sync Pool is a Bad Idea?
Notes on Python Decorator Python decorator is a function wrapper. It helps you wrap essential tasks around your functions such as logging, ratelimits, metrics updates etc. However, it has a peculiar behavior due to its dynamic implementation. If you run the following code, what is the expected output? def register(func): print(“hello to decorator!”) def another(): … More Notes on Python Decorator
cd command changes the current directory to desired valid path. The shell is a process that runs user commands. Each command is run by forking a new process and exec’ing. After exec, the child process dies. cd changes the current environment. If cd is an external command, the usual flow of fork->exec would cause environment … More Why ‘cd’ is not an external command like ls?
Concurrency is one of the most exciting features of Go language. A single threaded program runs serially, but if you have tasks that can run concurrently, you create threads for such tasks. Threads execute independently and progress concurrently. Go supports creation of thousands of threads in an application!! How is it possible? It’s Go’s runtime. … More Go Runtime Scheduler Design Internals
An “Abort” is a special type of error in a system, usually injected by an external actor. In a multi-threaded application, managing abort requests becomes pain. I am sharing a few observations that could improve/minimize mistakes. Implement one single handler for abort requests Outside the handler, if a thread is going to wait, and abort … More Rules for abort handling
The handling of abort of a operation is essential for a software. An abort represents: An error condition Internal errors Subsystem errors A user requested abort The requirements of abort handling are: Quickness: The ability to respond to an abort Reliability: The measure of abort getting accepted at any phase of software execution Robust: The … More A design of abort handling module