Closed
Bug 794078
Opened 12 years ago
Closed 6 years ago
Actors should return a response promise instead of sending reply packets directly
Categories
(DevTools :: Debugger, defect, P3)
Tracking
(Not tracked)
RESOLVED
INVALID
People
(Reporter: fitzgen, Unassigned)
References
(Blocks 1 open bug)
Details
An actor shouldn't have to know about |send| to do async, it should only have to deal in packets. If it is going to respond in an async fashion, it should return a promise. If it doesn't return anything, that should be an error.
Updated•12 years ago
|
Priority: -- → P3
Reporter | ||
Comment 1•11 years ago
|
||
There are currently three request methods in script.js that send responses via |this.conn.send| directly rather than returning a packet/promise(packet):
1. onAttach
2. onInterrupt
3. onExceptionUnwind
The reason they do this is because after they send the response, they push a new event loop.
If we tried to enter the event loop and then return the packet, we would just hang forever, so that's a no go.
Perhaps we can executeSoon-ify the entering of an event loop so it happens on the next tick after returning the packet? I don't think that would give us the guarantee that we won't receive a new packet before entering that nested event loop, though.
I think whatever fix we come up with might have to be integrated with bug 908452
Reporter | ||
Comment 2•11 years ago
|
||
Woops, onExceptionUnwind is definitely not a request method. Make that 2 request methods that use |this.conn.send| directly.
Reporter | ||
Comment 3•11 years ago
|
||
More request methods responding with |send| directly:
* gcli.js: GcliActor.prototype.execute - looks easy to port over at first glance
* tracer.js: TraceActor.prototype.onDetach - looks easy to port over at first glance
Reporter | ||
Comment 4•11 years ago
|
||
I think that is all of them.
Updated•10 years ago
|
Summary: When an actor is going to send a packet asyncly, it should return a promise of a packet, rather than calling send itself → Actors should return a response promise instead of sending reply packets directly
Updated•10 years ago
|
Blocks: dbg-server
Updated•6 years ago
|
Product: Firefox → DevTools
Comment 5•6 years ago
|
||
this is no longer relevant with the protocol work
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•