A simple, flexible scheduler for pools of distributed workers.
Redbike is a helpful building block with intentionally limited features. It's easy to schedule and distribute work however you like.
Redbike is available from the Python Package Index:
;;;;;;; - baker.clj - ;;;;;;;; | |
; | |
; By Luke Arno <luke.arno@gmail.com> | |
; Proof of concept for "baking" badge data into a PNG, | |
; a la Mozilla Open Badges. | |
(ns baker | |
"Bake badge data into PNGs." | |
(:import (java.io File) | |
(com.sun.imageio.plugins.png PNGMetadata) |
from flexmock import flexmock | |
# foo() is the code under test | |
# other.bar() is a dependency we are mocking | |
def foo(other): | |
other.bar(1, 2) | |
class OldVersionOfDep(): | |
def bar(self, x, y): |
from collections import deque | |
from threading import RLock | |
import time | |
class LeakyBucket(object): | |
def __init__(self, times, seconds, it=None): | |
self.times = times | |
self.seconds = seconds |
CREATE TABLE aaa (x INT, y INT); | |
/* | |
CREATE TABLE | |
*/ | |
INSERT INTO aaa VALUES (1,1), (2,2), (3,3); | |
/* | |
INSERT 0 3 | |
*/ | |
SELECT * FROM aaa; |
// inspired by https://blog.merovius.de/2017/06/18/how-not-to-use-an-http-router.html | |
package main | |
import ( | |
"fmt" | |
"net/http" | |
"path" | |
"strconv" | |
"strings" | |
) |
package main | |
import "fmt" | |
type Trie struct { | |
Children map[rune]*Trie | |
End bool | |
} | |
func NewTrie() *Trie { |