Skip to content

Instantly share code, notes, and snippets.

Avatar

Vladyslav Moisieienkov VMois

View GitHub Profile
@VMois
VMois / pubsub.go
Last active Aug 29, 2021
Pubsub in Golang using channels. Subscribe, Unsubscribe, Publish and Close methods are present
View pubsub.go
// Pubsub using channels. Subscribe, Unsubscribe, Publish and Close methods are present.
// Code is taken from this article https://eli.thegreenplace.net/2020/pubsub-using-channels-in-go/ and Unsubscribe method added by VMois
import "sync"
type Pubsub struct {
mu sync.RWMutex
subs map[string][]chan string
closed bool
}
@VMois
VMois / app_factory.py
Last active Aug 15, 2021
Flask app + background scheduler code from article
View app_factory.py
# Link to article: https://vmois.github.io/2021-08-14-flask-backgroung-scheduler/
import logging
import signal
from flask import Flask, request, jsonify
from scheduler import TASKS_QUEUE, SchedulerFactory
def create_app():
View genesis_public_key
045a352342085864ce26ed9757ac4259b7a5848c6c57033d5e11ba1df02c571616b28ed360b17ef6418fe9d7bd4ca6e6afad655ec20de1580e0dbcaa617de47722