I read it some time ago, but didn’t know if I could use it for my use case. I’m developing an integration with QtWebEngine(View) by “wire”, i.e. starting it as a process and communicating with it using stdin/out.
Now I’m looking for some way to dispatch events in the main thread. If that is even necessary(?)
Do you plan to make Qt an alternative backend for racket/gui ?
In that case, you can use eventspaces.
If not, then I am not 100% sure whether eventspaces can be used or not.
My hunch is that they can't be used.
The DrRacket repl is not the same as the terminal one.
But I think the difference, you are seeing, is that DrRacket replaces the event-dispatch-handler in order to co-exist with gui applications run from DrRacket.
@robby will know how DrRacket handles eventspaces - and whether you can reuse them.
I'm not really sure what @hnmdijkema's goal is, but it is the case that one can dispatch events by calling queue-callback; that's sensitive to current-eventspace and it adds to the event queue which the handler thread for the event space will pick up when it gets to that event.
@hnmdijkema if you're just getting some description of events as a data structure and you want to send them along to the appropriate racket controls, you can probably just call queue-callback where the thunk you pass is the event handler. I can't quite tell what your code is doing, as it has free variables in it but you probably want to avoid a global that's accessed without a lock from multiple threads (if that's what you're doing) and probably also you want to avoid calling sleep.