status-im / nim-status

MIT License
9 stars 6 forks source link

setupNat helper backed by nim-task-runner #273

Open michaelsbradleyjr opened 3 years ago

michaelsbradleyjr commented 3 years ago

Research creating our own setupNat helper that makes use of nim-task-runner, which will give us proper control over starting and stopping the thread running the nat loop.

While making use of nim-task-runner, it should ideally hide that usage (in a memory-safe manner, of course). It could be made available via import status/util/nat and would not be imported/re-exported by nim-status' top-level API so that it's import and usage is completely optional, e.g. a user of nim-status could use nim-eth's setupNat instead of our own, if that's what they prefer.

If it seems feasible, implement the helper.