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 crypto from 'crypto'; | |
export type SemElement = [string, (value: any | PromiseLike<any>) => void]; | |
export class Semaphor { | |
private curQueue: Map<string, SemElement>; | |
private readonly max: number; | |
private callbackQueue: SemElement[]; |
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 java.io.File | |
import java.time.Duration | |
import java.time.LocalDateTime | |
import java.time.format.DateTimeFormatter | |
fun readFileAsLinesUsingBufferedReader(fileName: String): List<String> | |
= File(fileName).bufferedReader().readLines() | |
fun main(args: Array<String>) { | |
val path="" //PATH |