Skip to content

Add select_stop, monitor_down, and dynamic_call resource callbacks - #20

Open
wrachwal wants to merge 1 commit into
elixir-nx:mainfrom
wrachwal:devel
Open

wrachwal wants to merge 1 commit into
elixir-nx:mainfrom
wrachwal:devel

Conversation

@wrachwal

Copy link
Copy Markdown
Contributor

Summary

  • Add optional select_stop, monitor_down, and dynamic_call callbacks for resource types.
  • Map them to the stop, down, and dyncall members of ErlNifResourceTypeInit.
  • Register resource types with enif_init_resource_type.
  • Expose compile-time callback detection flags through ResourcePtr<T>.
  • Document callback prototypes, mappings, and static_assert usage.

Testing

Added tests covering:

  • resource monitor notifications
  • ERL_NIF_SELECT_STOP handling
  • dynamic resource calls
  • compile-time recognition of all callback prototypes

@wrachwal

wrachwal commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

I rebased that patch onto v0.2.0 (try_decode - cool addition BTW).

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.

1 participant