-
Notifications
You must be signed in to change notification settings - Fork 42
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
Updates Async extern #160
Conversation
What's |
From Async doc:
|
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>>>>; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please prefix AsyncCargoObject
There was a problem hiding this 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>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Err, T
No description provided.