robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
dcd6cf5f34
master
1" Common functions for providers 2 3" Start the provider and perform a 'poll' request 4" 5" Returns a valid channel on success 6function ! provider#Poll ( argv , orig_name , log_env , ...) abort 7let job = { 'rpc' : v: true , 'stderr_buffered' : v: true } 8if a: 0 9let job = extend ( job , a: 1 ) 10endif 11try 12let channel_id = jobstart ( a: argv , job ) 13if channel_id > 0 && rpcrequest ( channel_id , 'poll' ) ==# 'ok' 14return channel_id 15endif 16catch 17echomsg v: throwpoint 18echomsg v: exception 19for row in get ( job , 'stderr' , []) 20echomsg row 21endfor 22endtry 23throw remote#host#LoadErrorForHost ( a: orig_name , a: log_env ) 24endfunction