Skip to content

Feature/enhance node java async options 90115432#198

Merged
joeferner merged 6 commits into
joeferner:masterfrom
jimlloyd:feature/Enhance-node-java-async-options_90115432
Mar 14, 2015
Merged

Feature/enhance node java async options 90115432#198
joeferner merged 6 commits into
joeferner:masterfrom
jimlloyd:feature/Enhance-node-java-async-options_90115432

Conversation

@jimlloyd

Copy link
Copy Markdown
Contributor

This PR extends the asyncOptions/Promises feature I added previously in PR #187 and PR #189.

It is now possible to specify the suffix that should be used for the Sync and Async variants, or to disable the generation of either of them. See the tests in the testAsyncOptions directory for examples.

Note that while in the previous PRs for promises I arranged to promisify three of the exported functions of the java module (newInstance, callMethod, callStaticMethod), this feature as currently implemented does not allow changing the names of the sync and async variants of those functions, due to complications with order of initialization. I'm currently just documenting this inconsistency.

Note also that this branch changes the npm test command to use a test runner. I'm open to suggestions for a better approach.

to: @joeferner
cc: @mhfrantz @jsdevel

…ants.

Generalizes asyncOptions to allow changing the suffix used for sync and
async style methods, and also allow any of them to be omitted.
We need a convenient way to invoke nodeunit multiple
times in independent processes. This testRunner runs
the standard tests in the `test` and `test8` directory
in on process, and then runs each of the files in
testAsyncOptions, each in their own process.

Perhaps I could have done this with a script, but
it's unclear to me whether a shell style script
would work on Windows. I expect this should be portable
across all platforms.
@jimlloyd

Copy link
Copy Markdown
Contributor Author

The second build error is with node 0.8. @joeferner, do you think that 0.8 support is still necessary? Perhaps 0.10 and 0.12 is sufficient? I'm going to add a commit to this PR to change .travis.yml, and a separate PR with only that change, which could be merged first.

joeferner added a commit that referenced this pull request Mar 14, 2015
…-options_90115432

Feature/enhance node java async options 90115432
@joeferner joeferner merged commit 1b65809 into joeferner:master Mar 14, 2015
@joeferner

Copy link
Copy Markdown
Owner

Nice, I really like these options.

@jimlloyd

Copy link
Copy Markdown
Contributor Author

Thanks! Please tag and publish 0.4.7.
FYI next task I am working on is to further your work on varargs.

@jimlloyd jimlloyd deleted the feature/Enhance-node-java-async-options_90115432 branch March 14, 2015 15:56
@jimlloyd

Copy link
Copy Markdown
Contributor Author

@joeferner I just noticed that the package.json engines should have been updated when we dropped node 0.8. Can you fix that before publishing 0.4.7? Thanks.

@joeferner

Copy link
Copy Markdown
Owner

Since we are dropping node 0.8.0 I'm wondering if the release should be 0.5.0. Will any of the changes you have planned change the API?

@jimlloyd

Copy link
Copy Markdown
Contributor Author

Good point. Nothing I have done so far breaks backwards compatibility. Is there a chance that our planned varargs change will break compatibility? I haven't started working with your branch yet, so I don't know. With the change, we will no longer be forced to create an array to pass in the varargs position, but code that does that now won't have to change, right?

If we do skip 0.4.7, we need to update one spot in the README.md where I reference 0.4.7.

By the way, README.md has a short section titled Release Notes, but the only release with any notes is 0.2.0. It seems to me that either we should remove that section, or we should try to retroactively update it with some of the highlights since 0.2.0. What do you think?

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.

2 participants