ataractic
ataractic
DDeno
Created by ataractic on 8/30/2023 in #help
Getting values from Deno KV in a Web Worker always return empty array despite working correctly o...
sure!
19 replies
DDeno
Created by ataractic on 8/30/2023 in #help
Getting values from Deno KV in a Web Worker always return empty array despite working correctly o...
i went with another approach, using message events to send job data both ways between the main thread to the worker, and it works! however i'm pretty sure it impacts performance pretty badly as compared to the first idea.
19 replies
DDeno
Created by ataractic on 8/30/2023 in #help
Getting values from Deno KV in a Web Worker always return empty array despite working correctly o...
i will do it once it can at least work, thanks for the tip!
19 replies
DDeno
Created by ataractic on 8/30/2023 in #help
Getting values from Deno KV in a Web Worker always return empty array despite working correctly o...
thanks you for trying :)
19 replies
DDeno
Created by ataractic on 8/30/2023 in #help
Getting values from Deno KV in a Web Worker always return empty array despite working correctly o...
i use a lot of code from saaskit to help me
19 replies
DDeno
Created by ataractic on 8/30/2023 in #help
Getting values from Deno KV in a Web Worker always return empty array despite working correctly o...
async function getValues<T>(
selector: Deno.KvListSelector,
options?: Deno.KvListOptions,
) {
const values = [];
const iter = kv.list<T>(selector, options);
for await (const { value } of iter) values.push(value);
return values;
}
async function getValues<T>(
selector: Deno.KvListSelector,
options?: Deno.KvListOptions,
) {
const values = [];
const iter = kv.list<T>(selector, options);
for await (const { value } of iter) values.push(value);
return values;
}
19 replies
DDeno
Created by ataractic on 8/30/2023 in #help
Getting values from Deno KV in a Web Worker always return empty array despite working correctly o...
yes sorry, here is getValues()
19 replies
DDeno
Created by ataractic on 8/30/2023 in #help
Getting values from Deno KV in a Web Worker always return empty array despite working correctly o...
export async function getAllJobs() {
return await getValues<Job>({ prefix: ["jobs"] });
}
export async function getAllJobs() {
return await getValues<Job>({ prefix: ["jobs"] });
}
19 replies
DDeno
Created by ataractic on 8/30/2023 in #help
Getting values from Deno KV in a Web Worker always return empty array despite working correctly o...
yes
19 replies
DDeno
Created by ataractic on 8/29/2023 in #help
Is there an idiomatic/common/modern way of creating a queue of jobs to be executed one after anot...
thank you everyone but i'm going with workers as a final choice
26 replies
DDeno
Created by ataractic on 8/29/2023 in #help
Is there an idiomatic/common/modern way of creating a queue of jobs to be executed one after anot...
i think i found my answer with this deno workers https://deno.land/manual@v1.36.3/runtime/workers
26 replies
DDeno
Created by ataractic on 8/29/2023 in #help
Is there an idiomatic/common/modern way of creating a queue of jobs to be executed one after anot...
but i see your point
26 replies
DDeno
Created by ataractic on 8/29/2023 in #help
Is there an idiomatic/common/modern way of creating a queue of jobs to be executed one after anot...
your function has one problem we should check if there is more tasks in the queue out of the startTask() function, because executing the same function inside it can potentially never get out if there is always jobs to be done and i'm sure it would cause memory congestion or leaks at some point.
26 replies
DDeno
Created by ataractic on 8/29/2023 in #help
Is there an idiomatic/common/modern way of creating a queue of jobs to be executed one after anot...
i understand, will try this method
26 replies
DDeno
Created by ataractic on 8/29/2023 in #help
Is there an idiomatic/common/modern way of creating a queue of jobs to be executed one after anot...
the real issue here is how to create a global variable and continuous running process that checks for the array
26 replies
DDeno
Created by ataractic on 8/29/2023 in #help
Is there an idiomatic/common/modern way of creating a queue of jobs to be executed one after anot...
i think i don't need a callback
26 replies
DDeno
Created by ataractic on 8/29/2023 in #help
Is there an idiomatic/common/modern way of creating a queue of jobs to be executed one after anot...
is the callback really needed?
26 replies
DDeno
Created by ataractic on 8/29/2023 in #help
Is there an idiomatic/common/modern way of creating a queue of jobs to be executed one after anot...
Since my task is always the same but for different conditions i can use the same function
26 replies
DDeno
Created by ataractic on 8/29/2023 in #help
Is there an idiomatic/common/modern way of creating a queue of jobs to be executed one after anot...
also how to create a global array
26 replies
DDeno
Created by ataractic on 8/29/2023 in #help
Is there an idiomatic/common/modern way of creating a queue of jobs to be executed one after anot...
so my idea is to create an array of objects that contain necessary information about a task but i would need to create a sub process that runs along the web server and checks for jobs? how can i do such a process?
26 replies