Skip to content

Instantly share code, notes, and snippets.

@fatih

fatih/job.vim

Created Sep 21, 2016
Embed
What would you like to do?
func! CloseHandler(channel)
while ch_status(a:channel) == 'buffered'
echomsg ch_read(a:channel)
endwhile
endfunc
let job = job_start(['go', 'build'], {'close_cb': 'CloseHandler'})
package main
func main() {
a
b
c
}
@fatih

This comment has been minimized.

Copy link
Owner Author

@fatih fatih commented Sep 21, 2016

Gives error:

image

@haya14busa

This comment has been minimized.

Copy link

@haya14busa haya14busa commented Sep 22, 2016

channel activity log.

call ch_logfile('/tmp/channellog', 'w')
==== start log session ====
  0.000021 : Starting job: go  build
  0.000039 on 1: Created channel
  0.000574 : looking for messages on channels
  0.040895 RECV on 1: '# local/haya14busa/tmp
./main.go:4: undefined: a
./main.go:5: undefined: b
./main.go:6: undefined: c
'
  0.041631 ERR on 1: channel_select_check(): Cannot read from channel, will close it soon
  0.041639 : looking for messages on channels
  0.041641 on 1: Closing channel because of previous read error
  0.041643 on 1: Closing channel
  0.041652 on 1: Invoking callbacks before closing
  0.041654 on 1: Invoking close callback CloseHandler
  0.043392 : looking for messages on channels
  1.453627 on 1: Dropping message '# local/haya14busa/tmp
./main.go:4: undefined: a
./main.go:5: undefined: b
./main.go:6: undefined: c
'
  1.453638 : looking for messages on channels
  8.063839 on 1: Job ended
  8.064224 : looking for messages on channels
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment