O'Reilly logo

Scala Functional Programming Patterns by Atul S. Khot

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Events

We all use keyboards in our everyday work life. We use them to write code and compose e-mails. There is no knowing when a certain key will be pressed. However, when a key is pressed, the user expects certain action to happen—for example, the letter indicated by the key should appear in the editor when we are writing code.

This seems natural enough, doesn't it? However, note that there is an elaborate mechanism at work here. The operating system piece needs to know which key was pressed. So, one way to find this out is to go and ask periodically whether any key was pressed, and if so, which one. This is called "polling" for any interesting information. When we poll, we go and ask the driver, at intervals about any status regarding whether ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required