> Why is this a problem? The procedure does async operations, so it must return 
> a future. You can hack around and not do that, but then your procedure 
> becomes blocking.

It is a problem because I don't know how to work around that effectively and 
use these procs as I intend to, i.e. use them in a simplified manner.

> Perhaps it would help if you explained what you are doing at a high level in 
> some more detail. What are you trying to simplify? Are you writing a library 
> on top of redis that makes certain operations simpler?

Yes. I don't want any hassle in the head nim file with accessing the database 
correctly, so I want to wrap the procedures to make access very easy for me.

> Again, that procedure performs async operations, so it must return a future.

Yes, that is the problem. How do I make the procs simpler if they always must 
return a Future (instead of a simple string, e.g.)? It is also needed to wrap 
every await'ed in an async procedure. So everything must be an async proc with 
its async properties.

> Please don't give up on async. Making your code synchronous will not get you 
> far.

I sat several hours at a couple of lines of code, because I couldn't wrap my 
head around using async access to the database the way I imagine to, i.e. 
simplified and safe in the main file.

Yesterday, I started rewriting the module synced and I am almost finished with 
it. It was a piece of cake. It also lets me implement the procs the way I 
imagine to; i.e. very simplified and doing what I want.

That said, I also have contemplated and read more about async programming, etc. 
and came to the conclusion that my very simple app to be won't really need 
async access, as it is intended to be used by 1 person for very simple 
operations, like tagging an entry with keywords. That's basically the gist of 
the minimally viable product I am trying to create.

Probably, I am not familiar enough with this language yet, to achieve some 
advanced simplification techniques with async procs, but right now in this 
situation I don't seem to need it. First, I want the app to run properly the 
way I want. If it will be expanded and improved, I may upgrade database access 
to be asynchronous, as soon as I will have gained enough knowledge on how to 
solve the application of the latter the way I imagine.

Anyway, thanks for the dedicated help, I appreciate it.

Reply via email to