Skip to content

Commit

Permalink
Add TODO comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed May 18, 2019
1 parent 49d5a6b commit 635e6b6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions http/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { STATUS_TEXT } from "./http_status.ts";
import { assert, fail } from "../testing/asserts.ts";
import { deferred, Deferred, MuxAsyncIterator } from "../util/async.ts";

// TODO(ry) This should be a class, not an interface.
interface HttpConn extends Conn {
// When read by a newly created request B, lastId is the id pointing to a previous
// request A, such that we must wait for responses to A to complete before
Expand Down Expand Up @@ -260,6 +261,12 @@ async function readRequest(
// for future requests to wait for.
httpConn.pendingDeferredMap.set(req.pipelineId, deferred());

// TODO(ry) Let's say the request has a body which is processed by the consumer
// of this iterator. We'd want to wait for this processing to be complete
// before reading a new set of headers. Therefore we might need an await
// statement after this yield, e.g. await req.done where done is a Promise
// that's resolved when the request has been processed.

req.conn = httpConn;
req.r = bufr;
req.w = new BufWriter(httpConn);
Expand Down

0 comments on commit 635e6b6

Please sign in to comment.