()
| 49 | } |
| 50 | |
| 51 | func (c *connection) Start() (*Playwright, error) { |
| 52 | go func() { |
| 53 | c.dispatchGID.Store(currentGoroutineID()) |
| 54 | for { |
| 55 | if !c.pollOnce() { |
| 56 | return |
| 57 | } |
| 58 | } |
| 59 | }() |
| 60 | |
| 61 | c.onClose = func() error { |
| 62 | if err := c.transport.Close(); err != nil { |
| 63 | return err |
| 64 | } |
| 65 | return nil |
| 66 | } |
| 67 | |
| 68 | return c.rootObject.initialize() |
| 69 | } |
| 70 | |
| 71 | // pollOnce reads and dispatches a single message. It returns false when the |
| 72 | // transport is closed or errors, signalling the receive loop to stop. It is |
nothing calls this directly
no test coverage detected