Your use-case is not clear.

Share the code you have in mind and we can see if there is any pitfalls.