Commit Graph

8 Commits

Author SHA1 Message Date
Daniel Martí
ad8809efb7 use time.NewTimer instead of time.After in Sleep
To fix a potential temporary goroutine leak; see the added comment. The
leaked goroutine would eventually stop once the timer is fired, but
until then, the goroutine could be unnecessarily left around.
2019-04-01 17:03:35 +01:00
Daniel Martí
c109f6ebfd use consistent context.Context var names 2019-04-01 12:18:16 +01:00
Daniel Martí
81a48280ef route all communication via the browser
Use a single websocket connection per browser, removing the need for an
extra websocket connection per target.

This is thanks to the Target.sendMessageToTarget command to send
messages to each target, and the Target.receivedMessageFromTarget event
to receive messages back.

The browser handles activity via a single worker goroutine, and the same
technique is used for each target. This means that commands and events
are dealt with in order, and we can do away with some complexity like
mutexes and extra go statements.
2019-04-01 12:18:16 +01:00
Kenneth Shaw
b0c2445e67 Splitting repositories 2017-12-28 11:17:14 +07:00
Daniel Martí
335d22d376 all: simplify some error variables
There's no need to put the error variables in a larger scope, nor define
them earlier than necessary. If anything, it makes the code harder to
follow, such as figuring out when nil errors are returned.
2017-12-18 10:51:37 +07:00
Kenneth Shaw
f73c429109 Renaming FrameHandler, updating to latest protocol.json, and code fixes 2017-02-12 12:50:46 +07:00
Kenneth Shaw
58283934b9 Fixing issues with code generation 2017-01-26 14:28:34 +07:00
Kenneth Shaw
20d575fece Initial import 2017-01-24 22:09:23 +07:00