Skip to content

Instantly share code, notes, and snippets.

View Ananto30's full-sized avatar
🎯
Focusing

Azizul Haque Ananto Ananto30

🎯
Focusing
View GitHub Profile
@Aspect
@Slf4j
public class LoggerAspect {
@Around("@annotation(Loggable)")
public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable {
long start = System.currentTimeMillis();
var result = joinPoint.proceed();
@Ananto30
Ananto30 / sse.go
Last active June 5, 2025 03:04
SSE message stream in Go
// Example SSE server in Golang.
// $ go run sse.go
// Inspired from https://gist.github.com/ismasan/3fb75381cd2deb6bfa9c
package main
import (
"encoding/json"
"fmt"
"log"
@Ananto30
Ananto30 / python_redis_pubsub.py
Created January 27, 2019 18:26
An example of Redis pub/sub in Python using asyncio_redis and async python programming
import asyncio_redis
import asyncio
channels = ['channel1', 'weather']
async def start():
connection = await asyncio_redis.Connection.create(host='127.0.0.1', port=6379)
subscriber = await connection.start_subscribe()
await subscriber.subscribe(channels)