Photo by Mike Chai

In Go programming language, we can achieve concurrency by using goroutine. Goroutine is one of the most basic units Go programming language. When we create go program, it has at least one goroutine, we called it the main goroutine, it is automatically created and started when the main process begin.

By combining Go’s concurrency primitives (goroutine and channel) and built-in sync package, we can build a pattern to help us writing maintainable concurrent Go code. There are many patterns can be implemented using Go, for example Fan-in Fan-out, Generator, Job Queue, Pipeline, Semaphore, Worker Pool etc. Each pattern has it…


Since version 2.0, Kong announced Go as one of the supported languages to be used on Kong API Gateway plugins development besides Lua. Kong releases the Plugin Development Kit (PDK) for Go users on their official repository. In this article, we’ll try to develop and deploy custom plugins for Kong 2.3 using Go.

We will use Docker to build Kong plugins using the official go-plugin-tool, this image use Go version 1.13 for development. Our Dockerfile:

# Stage 1 - Build plugin
# Pull image from official go-plugin-tool.
FROM kong/go-plugin-tool:2.0.4-alpine-latest AS builder
# Copy current workspace to container.
RUN mkdir -p…


Traffic Roadway
Traffic Roadway
Traffic Roadway (Photo by Pixabay)

Implementing concurrent process on Go programming language is very easy, just run your function with go prefix, and boooom, your function will not blocking your main thread.

But, what if your awesome concurrent function have responsibility with machine’s I/O ? For example your function will do 100 parallel HTTP POST request to REST API from other service. Yeah, your network I/O will busy on handling 100 request concurrently and this can slow down your I/O performance.

Here come the rescue Semaphore, based on Wikipedia,

Semaphore is a variable or abstract data type used to control access to a common resource…


“Concurrency is about dealing with lots of things at once. Parallelism is about doing lots of things at once.” — Rob Pike

Silver Pipes (Photo by jiawei cui)

Concurrency and Parallelism

What is the meaning of concurrency in programming?

Concurrency is the ability of a program for running multiple tasks simultaneously.

And what is parallelism ?

Parallelism is about doing multiple tasks at once.


Photo by Pixabay

One Time Password (OTP) via SMS dapat mempermudah pengguna aplikasi dalam proses autentikasi. Secara garis besar, proses nya dapat dilihat dalam gambar berikut:


Photo by Joey Kyber

Model View ViewModel (MVVM) merupakan salah satu architectural pattern yang dipakai dalam pengembangan perangkat lunak berbasis Graphical User Interface (GUI), arsitektur ini memisahkan business logic dengan GUI. Pada Android SDK sendiri, telah tersedia library Data Binding dari API level 7+.

Beberapa layer pada arsitektur MVVM :

Model

Model / entity adalah representasi dari data yang digunakan pada business logic, dapat berupa Plain Old Java Object (POJO), Kotlin Data Classes, dll.

View

Representasi UI dari sebuah aplikasi, pada Android sendiri view ini dapat berupa Activity atau Fragment.

ViewModel

Layer yang berinteraksi langsung dengan Model, serta menyajikan data untuk View layer.

Syafdia Okta

A lifelong learner

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store