Just declare the MyContext threadvar in a common unit used by both the middleware and your module code. That is not a problem.
Just declare the MyContext threadvar in a common unit used by both the middleware and your module code. That is not a problem.