Skip to content

Instantly share code, notes, and snippets.

@lixiaoyi
lixiaoyi / throttle.kt
Last active February 27, 2019 16:09
ReceiveChannel throttle function
fun <T> ReceiveChannel<T>.throttle(
settleTime: Long = 300,
scope: CoroutineScope
): ReceiveChannel<T> = scope.produce {
var job: Job? = null
consumeEach {
job?.cancel()
job = launch {
delay(settleTime)
send(it)
#!/usr/bin/env python
"""
Get the toolchains path
"""
import argparse
import atexit
import inspect
import os
import shutil
import stat
#!/bin/bash
set -e
set -x
# Set directory
SCRIPTPATH=`realpath .`
export ANDROID_NDK_HOME=$SCRIPTPATH/android-ndk-r20
OPENSSL_DIR=$SCRIPTPATH/openssl-1.1.1c
# Find the toolchain for your build machine