Hamster-Scripts: Functions (Hamster): Tasks

Tasks

HamThreadCount

Gives the number of currently active tasks.

Note: Client-connections to local servers and running scripts do not count as "active tasks" here.

Returns: Integer

print( HamThreadCount )

HamIsIdle

Returns TRUE (1) if there are currently no active tasks like purging, pulling news, sending mails etc.

Note: Client-connections to local servers and running scripts do not count as "active tasks" here.

Returns: Integer

if( HamIsIdle )
   # ...
endif

HamWaitIdle( <timeout> )
HamWaitIdle

Waits up to the given amount of milliseconds until all active tasks are finished. If no <timeout> is given, the function does not return until Hamster is idle again.

Note: Client-connections to local servers and running scripts do not count as "active tasks" here.

Returns: 0=OK, 1=Timeout, 2=Interrupted

HamWaitIdle

HamPurge( <option>, <group> )
HamPurge( <option> )
HamPurge

Starts a purge-thread (i.e. the deletion of old data). The bit-oriented parameter <option> describes, which old data should be deleted (1=articles, 2=news-history, 4=killfile-log, 8=mail-history). If it's omitted, all type of data are purged.

If <group> is given and 1=articles is selected, only the given group is purged.

Returns: 0=OK/Started, <>0=Not started

HamWaitIdle
HamPurge( 1 + 2 + 4 )
HamWaitIdle

HamRebuildGlobalLists

Starts a thread, which rebuilds some lists needed by Hamster, especially the list of newsgroups used for selecting new news-pulls.

Returns: 0=OK/Started, <>0=Not started

HamWaitIdle
HamRebuildGlobalLists
HamWaitIdle

HamRebuildHistory

Starts a thread, which deletes the current news-history and rebuilds it by adding the Message-IDs of all articles stored in Hamster.

Note: This may take some time with thousands of articles, so it should only be used, if it's really necessary! Be sure to wait until Hamster is idle again after calling this function!

Returns: 0=OK/Started, <>0=Not started

HamWaitIdle
HamRebuildHistory
HamWaitIdle

[www.elbiah.de Hamster Playground Documentation]