<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "Event",
  "identifier" : "/documentation/Event/EventLoop/runOnce()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Event"
    ],
    "preciseIdentifier" : "s:5Event0A4LoopC7runOnceyyF"
  },
  "title" : "runOnce()"
}
-->

# runOnce()

Runs the event loop once, processing any currently-ready events.

```
func runOnce()
```

## Discussion

Corresponds to `event_base_loop(base, EVLOOP_ONCE)`. Used internally by each
async method in [`Socket`](/documentation/Event/Socket) / [`ServerSocket`](/documentation/Event/ServerSocket) so that per-operation awaiters
drive the loop forward without requiring a caller-managed [`run()`](/documentation/Event/EventLoop/run()) task.

If no events are ready, libevent blocks until one becomes ready and then returns.