8Asynchronous Events

“Defer no time, delays have dangerous ends.”

—William Shakespeare

ALTHOUGH Java RTS has ample support for periodic, scheduled, real-time tasks, the world doesn’t always work that way. Many real-world events are asynchronous in nature; it’s simply unknown when these events will occur. Java RTS allows you to bind the execution of your code to events both within the JVM, and outside of it (also called “happenings”). In this chapter, we’ll examine what it takes to create an asynchronous event handler with Java RTS.

We’ll examine the various kinds of asynchronous events that Java RTS has support for, and how to create custom event handlers. Also, we’ll look at timer-based events that fire either once or repeatedly according to ...

Get Real-Time Java™ Programming with Java RTS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.