Skip to content

Commit

Permalink
Merge pull request #35 from tillt/till/rc_timeout
Browse files Browse the repository at this point in the history
Added RC communicate call timeout setting.
  • Loading branch information
rampage644 authored Aug 9, 2017
2 parents 7c0ba55 + 7af51cb commit e5bc30a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ Customize settings via "Preferences - Package Settings - SublimeRtags - Settings
/* Path to rc utility if not found in $PATH */
"rc_path": "/home/ramp/mnt/git/rtags/build/bin/rc",
/* Seconds for rc utility communication timeout default */
"rc_timeout": 0.5,
/* Path to rdm daemon if not found in $PATH */
"rdm_path": "",
Expand Down
6 changes: 5 additions & 1 deletion rtags.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@


def run_rc(switches, input=None, *args):
timeout = 0.5
if settings != None:
timeout = settings.get('rc_timeout', timeout)

p = subprocess.Popen([RC_PATH] + switches + list(args),
stderr=subprocess.PIPE,
stdout=subprocess.PIPE,
stdin=subprocess.PIPE)
print(' '.join(p.args))
return p.communicate(input=input, timeout=.5)
return p.communicate(input=input, timeout=timeout)

# TODO refactor somehow to remove global vars

Expand Down
3 changes: 3 additions & 0 deletions sublime-rtags.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
/* Path to rc utility if not found in $PATH */
"rc_path": "/home/ramp/bin/rc",

/* Seconds for rc utility communication timeout default */
"rc_timeout": 0.5,

/* Path to rdm daemon if not found in $PATH */
"rdm_path": "",

Expand Down

0 comments on commit e5bc30a

Please sign in to comment.