A EventLoop is a network server.
| 21 | |
| 22 | // A EventLoop is a network server. |
| 23 | type EventLoop interface { |
| 24 | // Serve registers a listener and runs blockingly to provide services, including listening to ports, |
| 25 | // accepting connections and processing trans data. When an exception occurs or Shutdown is invoked, |
| 26 | // Serve will return an error which describes the specific reason. |
| 27 | Serve(ln net.Listener) error |
| 28 | |
| 29 | // Shutdown is used to graceful exit. |
| 30 | // It will close all idle connections on the server, but will not change the underlying pollers. |
| 31 | // |
| 32 | // Argument: ctx set the waiting deadline, after which an error will be returned, |
| 33 | // but will not force the closing of connections in progress. |
| 34 | Shutdown(ctx context.Context) error |
| 35 | } |
| 36 | |
| 37 | /* The Connection Callback Sequence Diagram |
| 38 | | Connection State | Callback Function | Notes |
no outgoing calls
no test coverage detected
searching dependent graphs…