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

resources op #1119

Merged
merged 15 commits into from
Oct 30, 2018
Merged

resources op #1119

merged 15 commits into from
Oct 30, 2018

Conversation

bartlomieju
Copy link
Member

@bartlomieju bartlomieju commented Oct 30, 2018

Ref #1117

Todo:

  • return sensible text representation of Resource
  • tests

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

Nice!

js/resources.ts Outdated Show resolved Hide resolved
js/resources.ts Outdated Show resolved Hide resolved
js/resources.ts Show resolved Hide resolved
js/resources.ts Outdated Show resolved Hide resolved
js/resources_test.ts Outdated Show resolved Hide resolved
js/resources_test.ts Outdated Show resolved Hide resolved
@bartlomieju
Copy link
Member Author

@ry I updated PR, however another problem surfaced. In stdioResources test, actual number of resources is 4, somehow there is an open file. Any idea what might cause that?

@ry
Copy link
Member

ry commented Oct 30, 2018

@bartlomieju just compare before and after - perhaps there is a file that doesn't get closed in somewhere else in the tests - the purpose of this is to figure out about those things

@bartlomieju
Copy link
Member Author

It seams it fails exactly for that reason on AppVeyor. Looks like package.json was already open.

js/resources_test.ts Outdated Show resolved Hide resolved
js/resources_test.ts Outdated Show resolved Hide resolved
js/resources_test.ts Outdated Show resolved Hide resolved
src/resources.rs Show resolved Hide resolved
src/ops.rs Show resolved Hide resolved
@bartlomieju
Copy link
Member Author

ping @ry

const conn = await deno.dial("tcp", addr);
const buf = new Uint8Array(1024);
await conn.read(buf);
conn.close();
Copy link
Member

Choose a reason for hiding this comment

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

It's possible that the callback doesn't get called at all. Please add a counter which gets incremented in the callback, and check here
assertEqual(counter, 1)

Also you can remove await conn.read(buf); - I think that has no effect here.

Copy link
Member Author

Choose a reason for hiding this comment

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

You were right about that, I reworked it to use await, let me know if it looks good.

src/resources.rs Outdated Show resolved Hide resolved
src/resources.rs Outdated Show resolved Hide resolved
@bartlomieju bartlomieju changed the title WIP: resources op resources op Oct 30, 2018
Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

LGTM - awesome feature ! This will really help debugging.

@ry ry merged commit 946acbc into denoland:master Oct 30, 2018
@bartlomieju bartlomieju deleted the resources_op branch October 30, 2018 20:04
ry added a commit to ry/deno that referenced this pull request Nov 5, 2018
- Performance and stability improvements on all platforms.
- Add repl (denoland#998)
- Add deno.Buffer (denoland#1121)
- Support cargo check (denoland#1128)
- Upgrade Rust crates and Flatbuffers. (denoland#1145, denoland#1127)
- Add helper to turn deno.Reader into async iterator (denoland#1130)
- Add ability to load JSON as modules (denoland#1065)
- Add deno.resources() (denoland#1119)
- Add application/x-typescript mime type support (denoland#1111)
@ry ry mentioned this pull request Nov 5, 2018
ry added a commit that referenced this pull request Nov 5, 2018
- Performance and stability improvements on all platforms.
- Add repl (#998)
- Add deno.Buffer (#1121)
- Support cargo check (#1128)
- Upgrade Rust crates and Flatbuffers. (#1145, #1127)
- Add helper to turn deno.Reader into async iterator (#1130)
- Add ability to load JSON as modules (#1065)
- Add deno.resources() (#1119)
- Add application/x-typescript mime type support (#1111)
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