Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates Async extern #160

Merged
merged 3 commits into from Apr 18, 2017
Merged

Updates Async extern #160

merged 3 commits into from Apr 18, 2017

Conversation

JbIPS
Copy link

@JbIPS JbIPS commented Apr 13, 2017

No description provided.

@fullofcaffeine
Copy link

What's Async for? It can be easily confused with the @async metadata

@JbIPS
Copy link
Author

JbIPS commented Apr 14, 2017

From Async doc:

Async is a utility module which provides straight-forward, powerful functions for working with asynchronous JavaScript.

js/npm/Async.hx Outdated

typedef AsyncCallback<T> = T -> Void;
typedef AsyncOptionalCallback<T> = ?T -> Void;
typedef AsyncMapCallback<Err, T> = Err -> T -> Void;

typedef AsyncLoopCallback<Err> = AsyncCallback<Err> -> Void;
typedef TaskFunction<T, Err> = ?T -> (Null<Err> -> T);
typedef Task<T, Err> = EitherType<TaskFunction<T, Err>, Array<EitherType<String, TaskFunction<T, Err>>>>;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please prefix, like AsyncTask, AsyncTaskFunction, etc.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, maybe it would be nice to standardize Err, T order.

js/npm/Async.hx Outdated
@@ -116,3 +150,23 @@ implements npm.Package.Require<"async", "^0.9.0">

public static function noConflict() : Class<Async>;
}

extern class CargoObject<T, Err> {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please prefix AsyncCargoObject

Copy link
Owner

@clemos clemos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still lots of T, Err, I think it would be better to fix them all now ? I never really used async, but I assume this is very error prone.

js/npm/Async.hx Outdated
@@ -112,9 +112,9 @@ implements npm.Package.Require<"async", "^2.3.0">

// queue
// priorityQueue
public static function cargo<T, Err>(worker: AsyncMapCallback<T, Err>, payload: Int) : CargoObject<T, Err>;
public static function cargo<T, Err>(worker: AsyncMapCallback<T, Err>, payload: Int) : AsyncCargoObject<T, Err>;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Err, T

@clemos clemos merged commit f8ce287 into clemos:master Apr 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants