#Testing async/generator handlers locally?

2 messages · Page 1 of 1 (latest)

chrome tide
#

Is this supported? Running the code through the debugger, I only see run_local() calling run_job(), don't think it is...

Would be nice to have it included, if I had more time I'd PR, probably a little bit more thought needs to be put into this as far as DX goes/everything else you guys have going on, looks like it'd be as simple as adding something like this to run_local():

if rp_handler.is_generator(config["handler"]):
    results = []

    async for result in run_job_generator(config["handler"], local_job):
        results.append(result)
else:
    job_result = await run_job(config["handler"], local_job)
#

actually, i probably have to make this PR pretty soon for my own sake, if you guys wanna give me pointers on how you want the code setup, I'll do it, just want to avoid wasting time