This file contains 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 { randomUUID } from 'crypto' | |
// A concurrency-limited pool of promises generated from any async iterable compatible feed. | |
// A processor function is required to take the result of the async iteration and return a value. | |
// Processor func can be async | |
// | |
// Will only run [concurrency] operations at once | |
// The pool will fill as fast as the async iteration function can provide values, up to the max concurrency | |
export default async function* asyncPool(concurrency: number, itemFeed: AsyncIterable<any>, iteratorFn: (...args : any[]) => any) { | |
const promiseMap = new Map() |
This file contains 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
require 'net/http' | |
require 'json' | |
require 'uri' | |
@token = '' | |
def list_files | |
ts_to = (Time.now - 30 * 24 * 60 * 60).to_i # 30 days ago | |
params = { | |
token: @token, |
This file contains 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
// Web server does this, hits an endpoint | |
// { type: 'saml', strategy: company.strategy } | |
var company = Company.findByDomain(__domain); | |
if (company) { | |
var strategy = company.strategy; | |
} |