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

align return types for callbacks, for declare_functions #70

Open
milyin opened this issue Dec 12, 2024 · 0 comments
Open

align return types for callbacks, for declare_functions #70

milyin opened this issue Dec 12, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@milyin
Copy link
Contributor

milyin commented Dec 12, 2024

Some functions returns Promise, some not. I don't see any system in this.
E.g.:

interface LivelinessSubscriberOptions {
    callback?: (sample: Sample) => Promise<void>;
}
export declare class Liveliness {
     declare_subscriber(key_expr: IntoKeyExpr, options?: LivelinessSubscriberOptions): Subscriber;

but

export interface QueryableOptions {
    callback?: (query: Query) => void;
}
export declare class Session {
    declare_subscriber(key_expr: IntoKeyExpr, handler?: ((sample: Sample) => Promise<void>) | Handler): Promise<Subscriber>;

Also why for liveliness' Subscriber callback is in options, but for session's one - in parameter and there is no options (dummy at this moment)

Need to go through ts API and align it. The zenoh-c and zenoh-cpp APIs can be used as a reference

@milyin milyin assigned milyin and Charles-Schleich and unassigned milyin Dec 12, 2024
@milyin milyin added the enhancement New feature or request label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

2 participants