yes, it works without macro. probably, your code works because strutils is a
global module.
Heres a [macro for importing by
string](https://forum.nim-lang.org/t/3547/1#22257), try it out
Well you have a logical memory leak in your code, you keep adding things to you
sequence, `clients.add client`. If async is faster, it fills up your sequence
faster. In a memory constrained environment, don't have logical leaks.
Can you try testing with the Nim devel branch? Some allocator bugs have been
fixed there.
Thanks for hint, but idea that module name isn't hardcoded and contained inside
of string.
This can:
import macros
macro loadModule(): typed =
result = quote do:
import mymodule
loadModule()
I have done a little test to find out if I could run some microservices with
async code in memory constrained devices. Here is the test code:
[https://gist.github.com/aguspiza/80e34b5cf65aa3bbfd19c7339ee9b695](https://gist.github.com/aguspiza/80e34b5cf65aa3bbfd19c7339ee9b695)
That test uses 5x
Hi. Why a local module can't be found at macro-time? myModyle.nim:
echo "myModule loaded"
main.nim:
macro loadModule(): typed =
result = parseStmt("import myModule")
loadModule() # will rise exception "cannot open 'myModule'"
Is it possible
@dom96 is right, it can be done like this:
macro withTran(db, body: untyped): untyped =
quote do:
block:
proc action(`db`: apgPoolConnection) {.async.} =
`body`
let fut = doTransaction(action)
yield fut
Is there a correct way to handle ref object with atomic? Is it a bad way to
cast to ptr?
Thanks! I feel dumb now.
thanks! actually, import std/times is allowed but not std.times ; shouldn't
both be supported?
12 matches
Mail list logo