MCPcopy
hub / github.com/mxschmitt/playwright-go / Start

Method Start

connection.go:51–69  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49}
50
51func (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

Callers

nothing calls this directly

Calls 5

pollOnceMethod · 0.95
currentGoroutineIDFunction · 0.85
StoreMethod · 0.80
initializeMethod · 0.80
CloseMethod · 0.65

Tested by

no test coverage detected