π―
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Aspect | |
| @Slf4j | |
| public class LoggerAspect { | |
| @Around("@annotation(Loggable)") | |
| public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable { | |
| long start = System.currentTimeMillis(); | |
| var result = joinPoint.proceed(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Example SSE server in Golang. | |
| // $ go run sse.go | |
| // Inspired from https://gist.github.com/ismasan/3fb75381cd2deb6bfa9c | |
| package main | |
| import ( | |
| "encoding/json" | |
| "fmt" | |
| "log" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
NewerOlder