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 functools | |
def force_async(fn): | |
''' | |
turns a sync function to async function using threads | |
''' | |
from concurrent.futures import ThreadPoolExecutor | |
import asyncio | |
pool = ThreadPoolExecutor() |
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 functools | |
def force_async(fn): | |
''' | |
turns a sync function to async function using threads | |
''' | |
from concurrent.futures import ThreadPoolExecutor | |
import asyncio | |
pool = ThreadPoolExecutor() |
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
// random関数定義 | |
var random = function(_num){ | |
return Math.floor(Math.random() * _num); | |
} | |
// range関数定義 | |
var range = function(_start, _end, _step){ | |
if (arguments.length <= 1){ | |
_end = _start || 0; | |
_start = 0; |