Questions tagged [eventqueue]
77 questions
2
votes
1 answer
How do I design a Java Swing model that also responds to back-end events?
I have written a GUI for operating a card reader - mainly consisting of an ADD button that brings up a FileChooser dialog and queues the chosen File onto a CardHopper, which is displayed visually as a JList.
Now I want for the CPU (another JFrame,…

Chap
- 3,649
- 2
- 46
- 84
2
votes
1 answer
python avoid busy wait in event processing thread
How can I avoid busy_wait from the event consumer thread using asyncio?
I have a main thread which generates events which are processed by other thread. My event thread has busy_wait as it is trying to see if event queue has some item in it...
from…

moriarty007
- 2,054
- 16
- 20
2
votes
1 answer
find how many Runnables are waiting on the EventQueue
Is there any way to determine how many Runnables are currently queued in the EventQueue?... I mean the system EventQueue, i.e. all the Runnables to be run in the EDT. And mess with the queue, maybe?
What I want to do is to prioritise GUI…

mike rodent
- 14,126
- 11
- 103
- 157
1
vote
0 answers
Node.js Event Queue Priority
I'm writing a Node.js app that - long story short - prioritizes different IO processes, depending on a user's activity/location on a website. So far, everything is running great - important queued items run first, while less important things run…

jwegner
- 7,043
- 8
- 34
- 56
1
vote
2 answers
Get current instance of Runnable
I'm making an application that allows users to view task lists stored in different databases. So what happens is that, I have a list of the names of browsable databases (stored as a text file). Program loads the first database in that list and…

skytreader
- 11,467
- 7
- 43
- 61
1
vote
3 answers
JavaScript onMouseDown and onClick events versus event queue
I have following simple JS code (https://stackblitz.com/edit/web-platform-ueq5aq?file=script.js):
const baton = document.querySelector('button');
baton.addEventListener('mousedown', (e) => {
console.log('baton');
baton.addEventListener('click',…

Furman
- 2,017
- 3
- 25
- 43
1
vote
2 answers
why do i need EventQueue to start a new thread in java EDT? (JAVA)
Did I get it right? EDT is the main thread of GUI. To start a long operation, it's preferred to run it in new thread. So why do we need to use EventQueue for that? Why can't we simply create and run new thread just like in non-Swing programs?

nicks
- 2,161
- 8
- 49
- 101
1
vote
1 answer
How to know the approximate position of an enqueued event in a Javascript Engine's event queue?
Suppose we have a flurry of events being generated and being enqueued onto the available Javascript engine's event queue. Is there a method or any industry best practice to estimate the position of a particular event been enqueued?
Any insight on…

rhythmbytes
- 36
- 7
1
vote
0 answers
How to cancel Ajax queued up callbacks? (How to cancel long running method in Javascript?)
I am kind of new to javascript.
This is not a website scenario, but android webview with local javascript and html, css ist still used.I am trying to figure out the total length of ebook, which comprises of n html documents.
What I am doing is I…

urSus
- 12,492
- 12
- 69
- 89
1
vote
2 answers
Stopping another thread from the EDT (EventQueue)
So I created a basic swing interface with a stop button, and clicking it should stop a counting thread. When the application starts, a thread instance would allocate a runnable class which does a counting loop and logs it in the console. There is a…

ELM
- 529
- 2
- 7
- 19
1
vote
5 answers
Is update from EDT in swing an absolute rule or are there exceptions?
In Swing, the GUI is supposed to be updated by the EDT only, since the GUI components are not thread safe.
My question is, if I have a single thread, other than the EDT, that is dedicated to update a specific component, and this component is not…

Cratylus
- 52,998
- 69
- 209
- 339
1
vote
1 answer
Zk Notify multiple view
I'm working on a project using zk framework. I have many users who can use the application at the same time.
If one of them change a value of a field and fire the @notifychange I want to update the views of all other users.
For example if all the…

skander
- 109
- 1
- 13
1
vote
2 answers
setTimeout and UIEvent order
If a bunch of UIEvents are queued up because of some long-running method in a script, and at the end of the method I setTimeout(myfunc, 0), what order will myfunc get called in relative to handlers for the previously queued events? Is it guaranteed…

Andy
- 7,885
- 5
- 55
- 61
1
vote
3 answers
How to replace or restart a deadlocked Swing EventDispatchThread/EventQueue in Java 8 desktop application
A while back we added some code to our application to detect and attempt to recover from a Swing EDT deadlock, so the user could at least save their files (it would be best to not have a deadlock, but...). In Java 1.6, this is easy. Detect that…

Benjamin Horstman
- 743
- 7
- 12
1
vote
3 answers
Waiting for invokeLater() to be called
Is there a more elegant way to do what I'm doing below? That is, is there a more elegant way than polling and sleeping, polling and sleeping, and so on to know when a Runnable.run() method has been called via invokeLater()?
private int myMethod()…

Paul Reiners
- 8,576
- 33
- 117
- 202