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

ubus file descriptor passing support #263

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

nbd168
Copy link
Contributor

@nbd168 nbd168 commented Jan 1, 2025

Happy new year!
These changes implement support for the various ways of passing file descriptors via ubus.

nbd168 added 5 commits January 1, 2025 17:24
When a function supports many parameters, the order can be somewhat
confusing, especially when dealing with several optional ones.
In order to make this easier to use, support for passing an object with
named parameters.

for example:
	obj.notify("test", data, null, null, null, 1000);

can be written as:
	obj.notify({
		method: "test",
		data,
		timeout: 1000
	});

Signed-off-by: Felix Fietkau <[email protected]>
This can be used to synchronously complete a deferred ubus request,
waiting for completion or timeout.

Signed-off-by: Felix Fietkau <[email protected]>
This can be used to send and receive file descriptors from within an object
method call.

Signed-off-by: Felix Fietkau <[email protected]>
File descriptors can be passed via the named fd argument

Signed-off-by: Felix Fietkau <[email protected]>
Add a named parameter fd_cb, which is called when the callee returned a
file descriptor.

Signed-off-by: Felix Fietkau <[email protected]>
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