<!--
{
  "availability" : [

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

# init()

Creates a new event loop with a default backend configuration.

```
init()
```

## Discussion

Calls libevent’s `event_base_new()` internally. The backend (kqueue / epoll)
is selected by libevent based on the host OS; swift-event does not override
this selection.

Traps (via `fatalError`) if `event_base_new()` returns `NULL`, which indicates
catastrophic allocation failure. This behavior matches libevent’s own C-side
expectations and avoids propagating a `try?` through every consumer.