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

feat(plugin_api): Align DispatchOpFn signature to that of OpFn and access to OpState #9850

Closed
wants to merge 0 commits into from

Conversation

eliassjogreen
Copy link
Contributor

This pr adds plugin access to the deno resource table through a get_resource_table method in the plugin_api::Interface. This will be really useful for webgpu windowing and swapchains but also just for plugins in general not having to use their own resource table solution (usually a global HashMap) for storing resources.

@lucacasonato
Copy link
Member

I'm not really super happy with this. I would much prefer if we finally aligned op crates and plugins, and have them have the same signature (the one stating with deno_core::OpState).

@eliassjogreen eliassjogreen changed the title feat(plugin_api): resource table access feat(plugin_api): Align DispatchOpFn signature to that of OpFn and access to OpState Mar 22, 2021
@lucacasonato
Copy link
Member

lucacasonato commented Mar 22, 2021

Can you also add a test that checks if deno_core::json_op_async and deno_core::json_op_sync work with plugins now?

@eliassjogreen
Copy link
Contributor Author

Sure, it seems to work fine when using both json_op_sync and json_op_async and the internal core.jsonOpSync and core.jsonOpAsync functions for calling and getting a response.

test_plugin/src/lib.rs Outdated Show resolved Hide resolved
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.

3 participants