Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
1367bcf
update Writable Event Document
takashiski Sep 4, 2019
13f31e4
redefie writable.end()
takashiski Sep 4, 2019
77e9d14
update writable.setDefaultEncoding()
takashiski Sep 4, 2019
9e76a7b
update variable on v11
takashiski Sep 4, 2019
53d431d
add variables on v11 or later
takashiski Sep 4, 2019
4b3437d
add option functons
takashiski Sep 4, 2019
d9eabb3
update Writable.new()s options
takashiski Sep 4, 2019
d44a407
fix typo
takashiski Sep 4, 2019
74cc811
comment out redefinitions on http
takashiski Sep 5, 2019
62f2cca
update Duplex.hx's writable functions
takashiski Sep 5, 2019
ae9e4c4
update
takashiski Sep 5, 2019
567bbe0
sort ReadableEvent
takashiski Sep 5, 2019
a74ece9
update doccomment
takashiski Sep 5, 2019
daf6795
update comment
takashiski Sep 5, 2019
20c4d03
update comment
takashiski Sep 5, 2019
87a3cea
comment out function it return AsyncIteratr
takashiski Sep 5, 2019
5245a6e
update duplex
takashiski Sep 5, 2019
4142dca
update Transform
takashiski Sep 5, 2019
205b92b
fixed typo
takashiski Sep 5, 2019
fa4334a
typed transformnewoptions.transform
takashiski Sep 5, 2019
0720a9a
remove re-define members on http
takashiski Sep 5, 2019
fd83165
change comment
takashiski Sep 5, 2019
20c6489
update passthrough's doc comment
takashiski Sep 10, 2019
707faf6
update doccomment
takashiski Sep 10, 2019
9704f28
update dccomment
takashiski Sep 10, 2019
ca4f30f
change destroyed access identifier
takashiski Sep 10, 2019
0a4ba5b
change EitherType to overload
takashiski Sep 10, 2019
7b4d3e8
Change EitherType to overload
takashiski Sep 10, 2019
b754191
update
takashiski Sep 10, 2019
8fe3479
update
takashiski Sep 10, 2019
386d97b
update
takashiski Sep 10, 2019
a4f914d
comment out re-define variable
takashiski Sep 10, 2019
a92f460
change chunk and like a chunk to Dynamic
takashiski Sep 10, 2019
e4ea950
update Duplex.hx definition under new Stream's
takashiski Sep 10, 2019
7795cd2
comment out @native in typedef
takashiski Sep 10, 2019
0c9962f
fix typo
takashiski Sep 12, 2019
07bec49
update comment
takashiski Sep 12, 2019
10a27d1
update difinition
takashiski Sep 12, 2019
51c8d0a
update definition
takashiski Sep 12, 2019
3c7b0a7
Apply the review feedback
terurou Sep 16, 2019
429a807
Remove unused import
terurou Sep 16, 2019
1a05a2d
Remove unused import
terurou Sep 16, 2019
ed63c46
Fix Stream extern
terurou Sep 17, 2019
5e23136
minor
terurou Sep 17, 2019
c6b563a
Fix minor
terurou Oct 2, 2019
263ea8e
Fix for haxe3.4
terurou Oct 2, 2019
99fadd1
Fix Stream,pipeline
terurou Oct 2, 2019
5f88b30
Add comment out
terurou Oct 2, 2019
e5b0926
Change Buffer to Dynamic
terurou Oct 2, 2019
d5394f7
change to override and add comment
takashiski Oct 4, 2019
ce7571d
update destroy's
takashiski Oct 4, 2019
11981e2
update comment _destroy()
takashiski Oct 4, 2019
6e14587
add comment
takashiski Oct 4, 2019
852267a
add comment
takashiski Oct 4, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/StreamImplSimpleProtocol2.hx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class SimpleProtocol extends Transform<SimpleProtocol> {
var _rawHeader = [];
var header:Buffer;

override function _transform(chunk:Buffer, encoding, callback) {
override function _transform(chunk:Dynamic, encoding, callback) {
if (!this._inBody) {
// check if the chunk has a \n\n
var split = -1;
Expand Down
32 changes: 32 additions & 0 deletions src/js/node/Stream.hx
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,46 @@

package js.node;

import haxe.extern.Rest;
import js.node.stream.Writable.IWritable;
import js.node.events.EventEmitter;
import js.node.stream.Readable.IReadable;
#if haxe4
import js.lib.Error;
import js.lib.Promise;
#else
import js.Error;
import js.Promise;
#end

/**
Base class for all streams.
**/
@:jsRequire("stream") // the module itself is also a class
extern class Stream<TSelf:Stream<TSelf>> extends EventEmitter<TSelf> implements IStream {
private function new();

/**
A module method to pipe between streams forwarding errors and properly cleaning up
and provide a callback when the pipeline is complete.

@see https://nodejs.org/api/stream.html#stream_stream_pipeline_streams_callback
**/
@:overload(function(readable:IReadable, callback:Null<Error>->Void):Void {})
@:overload(function(readable:IReadable, writable1:IWritable, callback:Null<Error>->Void):Void {})
@:overload(function(readable:IReadable, writable1:IWritable, writable2:IWritable, callback:Null<Error>->Void):Void {})
@:overload(function(readable:IReadable, writable1:IWritable, writable2:IWritable, writable3:IWritable, callback:Null<Error>->Void):Void {})
@:overload(function(readable:IReadable, writable1:IWritable, writable2:IWritable, writable3:IWritable, writable4:IWritable,
callback:Null<Error>->Void):Void {})
@:overload(function(readable:IReadable, writable1:IWritable, writable2:IWritable, writable3:IWritable, writable4:IWritable, writable5:IWritable,
callback:Null<Error>->Void):Void {})
@:overload(function(readable:IReadable, writable1:IWritable, writable2:IWritable, writable3:IWritable, writable4:IWritable, writable5:IWritable,
writable6:IWritable, callback:Null<Error>->Void):Void {})
@:overload(function(readable:IReadable, writable1:IWritable, writable2:IWritable, writable3:IWritable, writable4:IWritable, writable5:IWritable,
writable6:IWritable, writable7:IWritable, callback:Null<Error>->Void):Void {})
@:overload(function(readable:IReadable, writable1:IWritable, writable2:IWritable, writable3:IWritable, writable4:IWritable, writable5:IWritable,
writable6:IWritable, writable7:IWritable, writable8:IWritable, callback:Null<Error>->Void):Void {})
static function pipeline(readable:IReadable, streams:Rest<IWritable>):Promise<Void>;
}

/**
Expand Down
13 changes: 3 additions & 10 deletions src/js/node/http/ClientRequest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -207,16 +207,9 @@ extern class ClientRequest extends Writable<ClientRequest> {
*/
var socket(default, null):Socket;

/**
Is `true` after `request.end()` has been called.
This property does not indicate whether the data has been flushed, for this use `request.writableFinished` instead.
**/
var writableEnded(default, null):Bool;

/**
Is `true` if all data has been flushed to the underlying system, immediately before the `'finish'` event is emitted.
**/
var writableFinished(default, null):Bool;
// This field is defined in super class.
// var writableEnded(default, null):Bool;
// var writableFinished(default, null):Bool;
}

typedef InformationEventData = {
Expand Down
2 changes: 1 addition & 1 deletion src/js/node/http/IncomingMessage.hx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ extern class IncomingMessage extends Readable<IncomingMessage> {
Calls `destroy()` on the socket that received the `IncomingMessage`.
If `error` is provided, an `'error'` event is emitted and `error` is passed as an argument to any listeners on the event.
**/
function destroy(?error:Error):Void;
override function destroy(?error:Error):IncomingMessage;

/**
The request/response headers object.
Expand Down
15 changes: 4 additions & 11 deletions src/js/node/http/ServerResponse.hx
Original file line number Diff line number Diff line change
Expand Up @@ -168,17 +168,6 @@ extern class ServerResponse extends Writable<ServerResponse> {
**/
var statusMessage:String;

/**
Is `true` after `end()` has been called. This property does not indicate whether the data has been flushed,
for this use `writableFinished` instead.
**/
var writableEnded(default, null):Bool;

/**
Is `true` if all data has been flushed to the underlying system, immediately before the `'finish'` event is emitted.
**/
var writableFinished(default, null):Bool;

/**
Sends a HTTP/1.1 100 Continue message to the client, indicating that the request body should be sent.
See the `'checkContinue'` event on `Server`.
Expand Down Expand Up @@ -214,4 +203,8 @@ extern class ServerResponse extends Writable<ServerResponse> {
Sends a HTTP/1.1 102 Processing message to the client, indicating that the request body should be sent.
**/
function writeProcessing():Void;

// This field is defined in super class.
// var writableEnded(default, null):Bool;
// var writableFinished(default, null):Bool;
}
6 changes: 5 additions & 1 deletion src/js/node/net/Socket.hx
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,12 @@ extern class Socket extends js.node.stream.Duplex<Socket> {
/**
A boolean value that indicates if the connection is destroyed or not.
Once a connection is destroyed no further data can be transferred using it.

define in Stream/Readable.hx
**/
var destroyed(default, null):Bool;
// var destroyed(default, null):Bool;

#if haxe4
/**
Ensures that no more I/O activity happens on this socket.
Only necessary in case of errors (parse error or so).
Expand All @@ -260,6 +263,7 @@ extern class Socket extends js.node.stream.Duplex<Socket> {
any listeners for that event will receive exception as an argument.
**/
function destroy(?exception:Error):Void;
#end

/**
Sets the socket to timeout after `timeout` milliseconds of inactivity on the socket.
Expand Down
Loading