Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

RFC: New Denops interface for passing AbortSignal #423

Closed
lambdalisue opened this issue Sep 24, 2024 · 0 comments
Closed

RFC: New Denops interface for passing AbortSignal #423

lambdalisue opened this issue Sep 24, 2024 · 0 comments

Comments

@lambdalisue
Copy link
Member

Related to #415

To pass AbortSignal to methods of Denops, I'm wondering a new interface like

export interface Denops {
  // ...

  redraw(force?: boolean, options?: { signal?: AbortSignal }): Promise<void>;
  
  call(fn: string, args: unknown[], options?: { signal?: AbortSignal }): Promise<unknown>;
  
  batch(calls: [string, ...unknown[]][], options?: { signal?: AbortSignal }): Promise<unknown[]>;
 
  cmd(cmd: string, options?: { ctx?: Context, signal?: AbortSignal }): Promise<void>;
 
  eval(expr: string, options?: { ctx?: Context, signal?: AbortSignal }): Promise<unknown>;

  dispatch(name: string, fn: string, args: unknown[], options?: { signal?: AbortSignal }): Promise<unknown>;
}

But this is an interface breaking change that we should try hard to avoid while users may want to use denops plugins that followed or doesn't followed this breaking change in same time.

So we may need to add new methods like

export interface Denops {
  // ...

  redraw2(force?: boolean, options?: { signal?: AbortSignal }): Promise<void>;
  
  call2(fn: string, args: unknown[], options?: { signal?: AbortSignal }): Promise<unknown>;
  
  batch2(calls: [string, ...unknown[]][], options?: { signal?: AbortSignal }): Promise<unknown[]>;
 
  cmd2(cmd: string, options?: { ctx?: Context, signal?: AbortSignal }): Promise<void>;
 
  eval2(expr: string, options?: { ctx?: Context, signal?: AbortSignal }): Promise<unknown>;

  dispatch2(name: string, fn: string, args: unknown[], options?: { signal?: AbortSignal }): Promise<unknown>;
}

But you know, it looks horrible. Does anyone has more brilliant idea for this?

@vim-denops vim-denops locked and limited conversation to collaborators Sep 24, 2024
@lambdalisue lambdalisue converted this issue into discussion #424 Sep 24, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant