Skip to main content
Deno 2 is finally here ๐ŸŽ‰๏ธ
Learn more
Module

x/denops_std/function/vim/mod.ts>ch_canread

๐Ÿ“š Standard module for denops.vim
Go to Latest
function ch_canread
import { ch_canread } from "https://deno.land/x/denops_std@v5.2.0/function/vim/mod.ts";

Return non-zero when there is something to read from {handle}. {handle} can be a Channel or a Job that has a Channel.

This is useful to read from a channel at a convenient time, e.g. from a timer.

Note that messages are dropped when the channel does not have a callback. Add a close callback to avoid that.

Can also be used as a method:

GetChannel()->ch_canread()

Parameters

denops: Denops
handle: unknown

Returns

Promise<number>