Overview | Index by: file name | procedure name | procedure call | annotation

thread.tcl Annotations

Created from source/thread.tcl
This is the entry point for every new MikroConf session.

Procedure Summary
Alert { args }
          
bgerror { msg }
          Our own error handling procedure for the Master
bufsize { }
          Retrieve the number of pending
cleanup { }
          Called on session termination to clean up memory
Critical { args }
          
Debug { args }
          
Emergency { args }
          
Error { args }
          
errorproc { threadId errorInfo }
          Custom errorproc to handle background errors arrising from asynchronous script executions between threads.
exit { {reason Unspecified} }
          Terminate
Info { args }
          
more { args }
          Like 'puts' but automatically switches to --more-- functionality when the string to be printed is going to take more lines than those available on the remote terminal screen.
nbgets { args }
          A 'gets' wrapper to simulate the behavior of Tcl's gets command when operating on a nonblocking non-canonical channel, which is what stdin is in a Session thread.
nbgets_event { channel param }
          Fileevent handler to process and record user
Notice { args }
          
popbuf { {num all} }
          Retrieve pending messages to be
pushbuf { txt }
          If prompt is busy executing some command, buffer incoming messages for printing.
unknown { args }
          This version of unknown looks for the unknown procedure on the Master thread and if found, executes it there and bring back the result.
Warning { args }
          

Procedure Detail

Alert

proc Alert { args }
Defined in:
thread.tcl, line 82

bgerror

proc bgerror { msg }
Our own error handling procedure for the Master interpreter
Parameters:
msg - The error message to display
Defined in:
thread.tcl, line 131

bufsize

proc bufsize {  }
Retrieve the number of pending messages.
Returns:
The number of pending messages.
Defined in:
thread.tcl, line 465

cleanup

proc cleanup {  }
Called on session termination to clean up memory etc.
Defined in:
thread.tcl, line 112

Critical

proc Critical { args }
Defined in:
thread.tcl, line 81

Debug

proc Debug { args }
Defined in:
thread.tcl, line 76

Emergency

proc Emergency { args }
Defined in:
thread.tcl, line 83

Error

proc Error { args }
Defined in:
thread.tcl, line 80

errorproc

proc errorproc { threadId errorInfo }
Custom errorproc to handle background errors arrising from asynchronous script executions between threads. If we don't use one, then errors are printed to stderr, which we don't want. bgerror is executed as well, after this.
Parameters:
threadId - Thread Id.
errorInfo - Error info.
Defined in:
thread.tcl, line 156

exit

proc exit { {reason Unspecified} }
Terminate session.
Parameters:
reason - Reason for termination.
Defined in:
thread.tcl, line 106

Info

proc Info { args }
Defined in:
thread.tcl, line 77

more

proc more { args }
Like 'puts' but automatically switches to --more-- functionality when the string to be printed is going to take more lines than those available on the remote terminal screen. The follow prerequisites must also be fulfilled for this to happen: * The output channel is stdout. * Flow control is enabled. We outsource the --more-- functionalily from the external 'more' busybox utility. @assume The syntax of the command will not change.
Parameters:
args - The normal arguments for the 'puts' command. @error
Defined in:
thread.tcl, line 357

nbgets

proc nbgets { args }
A 'gets' wrapper to simulate the behavior of Tcl's gets command when operating on a nonblocking non-canonical channel, which is what stdin is in a Session thread. We have the following requirements from the implementation: 1. It doesn't set the channel in blocking mode, which would prevent ::session::session_close from closing the session. 2. When Ctrl + C is pressed, then it returns imediately an empty list. 3. When Ctrl + ^ and then x, is pressed then it terminates imediately returning an error to the caller which will cause it to terminate as well. It only supports the one-line argument syntax of the original gets: gets channelId Backspace can be used as in the original command. The following options are supported: -noecho : The typed characters are not displayed back to the user. Appropriate for passwords. (default: echo characters) -nonewline : Don't print a new line when the user presses enter to submit the string. (default: print newline) -end : Specifies a string that will signify the end of input. Defaults to newline. This option allow getting multi-line text. -length : Set a limit on the number of characters the user can enter. (default: no limit) @error
Defined in:
thread.tcl, line 186

nbgets_event

proc nbgets_event { channel param }
Fileevent handler to process and record user input.
Parameters:
channel - The channel user input is coming from.
param - A serialized array with the parameters supported by "nbgets".
Defined in:
thread.tcl, line 256

Notice

proc Notice { args }
Defined in:
thread.tcl, line 78

popbuf

proc popbuf { {num all} }
Retrieve pending messages to be printed.
Parameters:
num - The number of messages to retrieve (the oldest ones). If {} then all messages are retrieved.
Returns:
A list of pending messages in chronological order from oldest to most recent.
Defined in:
thread.tcl, line 450

pushbuf

proc pushbuf { txt }
If prompt is busy executing some command, buffer incoming messages for printing. Otherwise print at once.
Parameters:
txt - The message to be printed.
Defined in:
thread.tcl, line 432

unknown

proc unknown { args }
This version of unknown looks for the unknown procedure on the Master thread and if found, executes it there and bring back the result. If it's not found in the Master thread, then the "unknown" of the master thread will be executed. Note that this overwrites the original unknown, which we don't need.
Parameters:
args - The regular arguments to unknown. @error
Defined in:
thread.tcl, line 94

Warning

proc Warning { args }
Defined in:
thread.tcl, line 79

Overview | Index by: file name | procedure name | procedure call | annotation
File generated 2010-03-13 at 22:28.