Skip to content

Instantly share code, notes, and snippets.

@biasedbit
biasedbit / run_workers.py
Last active November 22, 2023 20:34
Worker runner
import itertools
import os
import signal
import subprocess
import sys
import threading
from enum import Enum
from typing import Any, Optional
# Script to run multiple workers in parallel as sub-processes. Blocks until all
@biasedbit
biasedbit / gist:5266277
Created March 28, 2013 19:55
BBHTTP transfer rate proposal
struct BBTransferRate {
unsigned long bytesPerSecond;
NSTimeInterval duration;
};
typedef struct BBTransferRate BBTransferRate;
BBTransferRate BBTransferRateMake(unsigned long bytesPerSecond, NSTimeInterval duration)
{
BBTransferRate threshold;
threshold.bytesPerSecond = bytesPerSecond;