Skip to content

Commit

Permalink
Make it clear how long it takes for asynchronous callbacks to reply
Browse files Browse the repository at this point in the history
  • Loading branch information
xolox committed Jun 30, 2014
1 parent 0a70769 commit 92172c6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -38,7 +38,7 @@ from the source code of the miscellaneous scripts using the Python module
<!-- Start of generated documentation -->

The documentation of the 92 functions below was extracted from
19 Vim scripts on June 30, 2014 at 02:45.
19 Vim scripts on June 30, 2014 at 02:47.

### Asynchronous Vim script evaluation

Expand Down
5 changes: 3 additions & 2 deletions autoload/xolox/misc/async.vim
@@ -1,7 +1,7 @@
" Asynchronous Vim script evaluation.
"
" Author: Peter Odding <peter@peterodding.com>
" Last Change: June 22, 2014
" Last Change: June 30, 2014
" URL: http://peterodding.com/code/vim/misc/
"
" The `xolox#misc#async#call()` function builds on top of `xolox#misc#os#exec()`
Expand Down Expand Up @@ -144,6 +144,7 @@ function! xolox#misc#async#call(options) " {{{1
let g:xolox#misc#async#counter += 1
let request = {'function': a:options['function']}
let request['arguments'] = get(a:options, 'arguments', [])
let request['starttime'] = xolox#misc#timer#start()
let request['number'] = unique_number
let callback = get(a:options, 'callback')
if !empty(callback)
Expand Down Expand Up @@ -211,8 +212,8 @@ function! xolox#misc#async#callback_to_parent(response) " {{{1
" enables more or less instant callbacks after running an asynchronous
" function.
let unique_number = a:response['number']
call xolox#misc#msg#debug("vim-misc %s: Processing asynchronous callback #%i ..", g:xolox#easytags#version, unique_number)
let request = g:xolox#misc#async#requests[unique_number]
call xolox#misc#timer#stop("vim-misc %s: Processing asynchronous callback #%i after %s ..", g:xolox#easytags#version, unique_number, request['starttime'])
call remove(g:xolox#misc#async#requests, unique_number)
let callback = get(request, 'callback')
if !empty(callback)
Expand Down
2 changes: 1 addition & 1 deletion doc/misc.txt
Expand Up @@ -167,7 +167,7 @@ from the source code of the miscellaneous scripts using the Python module
'vimdoctool.py' included in vim-tools [5].

The documentation of the 92 functions below was extracted from 19 Vim scripts
on June 30, 2014 at 02:45.
on June 30, 2014 at 02:47.

-------------------------------------------------------------------------------
*misc-asynchronous-vim-script-evaluation*
Expand Down

0 comments on commit 92172c6

Please sign in to comment.