Webthing-python threading problem with mraa gpio interrupt

I have built a webthing-python that interacts with GPIO over MRAA framework.
Calling a funcition by interrupt is supported my MRAA and documented here.
The problem is that it automaticaly creates a new thread and im not able to get out of that.

I added log atributes and it now looks like this:

        format='%(asctime)s '
        '%(filename)s:'
        '%(lineno)s '
        '%(processName)s '
        '%(process)d, '
        '%(threadName)s '
        '%(thread)d, '
        '%(module)s, '
        '%(funcName)s, '
        '[%(levelname)s] '
        '%(message)s'

Copy of four lines:

2020-11-07 13:33:48,902 pwm-thing.py:382 MainProcess 29686, MainThread 2013261444, pwm-thing, get_motion, [DEBUG] currently [<_MainThread(MainThread, started 2013261444)>] are active while 1 are active and we are in <_MainThread(MainThread, started 2013261444)>
2020-11-07 13:33:49,020 pwm-thing.py:590 MainProcess 29686, MainThread 2013261444, pwm-thing, run_server, [INFO] starting the server

after run_server() and interrupt call:

2020-11-07 13:34:40,927 pwm-thing.py:393 MainProcess 29686, Dummy-1 1999891816, pwm-thing, interrupt_call, [DEBUG] currently [<_MainThread(MainThread, started 2013261444)>, <Engine(zeroconf-Engine, started daemon 1999748456)>, <Reaper(zeroconf-Reaper, started daemon 1999605096)>] are active while 3 are active and we are in <_DummyThread(Dummy-1, started daemon 1999891816)>
2020-11-07 13:34:40,929 pwm-thing.py:396 MainProcess 29686, Dummy-1 1999891816, pwm-thing, interrupt_call, [DEBUG] interrupt_call

Is there some python wizard here that can help me get back to the Tornado MainThread where webthing-python lives in?

take a look at this:

You should try searching discuss for examples.

Well. That’s my question regarding the usage of an interrupt in tornado.
I am working on this task since quite a while.
The answer is regarding the possibilities of using asynchronous tornado options.

I’m asking for Parallel Threading options here, not asynchronous.

Both are complex areas of code and it seems to me, to get back to a Tornado MainThread from an imported Module (that automatically starts a new thread) is a mixture that is depending on very good understanding of the programming Language to solve it.

I have searched, and I have tested what I was able to find.
But while searching for one of the terms is straight forward, the mixture of both is not.

I am able to integrate goiozero buttons to my web thing using pointers from that thread. Look for a code sample by mrstegman. It is what I adapted, I use the when_pressed and when_released callbacks. You have to get a reference to the tornado io loop to work with.

Should be able to use a similar technique for what you want to do.

My implementation looks like this (i am working on a thing builder system)\

Button mapping to call backs and hand over to ioloop is here:

thing is defined in a separate file:

The component is defined here: