egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

thread

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
haferbrei
Voice


Joined: 08 Apr 2020
Posts: 21

PostPosted: Mon Apr 12, 2021 7:14 pm    Post subject: thread Reply with quote

I want to run a bash script that packs folders. This takes a little time and during this time the bot is not responsive.
How can I move the script to a thread?
Code:
set zipper [thread::create {
puts "Starting zipper thread"
exec bash.script
}]


Unfortunately, this does not work.
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1138

PostPosted: Mon Apr 12, 2021 10:43 pm    Post subject: Re: thread Reply with quote

haferbrei wrote:

...
How can I move the script to a thread?
...


I think there is a Thread package. However I am not familiar with it. Maybe someone else here will comment on it.

You're running into what is called: blocking.

I'm fuzzy on this - been a long time - but you can use the
open
command with pipes to deal with this.

No doubt you can use the search function here in the forum, and find lots on the open command.
Perhaps even something on that Thread package, too.

Here's one post that might interest you:
http://forum.egghelp.org/viewtopic.php?p=100611

I see a comment in some code there:
Code:

...
# Description:
#
# This script is for other scripters to use as a replacement
# for the "exec" command so that they may execute commands to
# the system in the background. (non-blocking mode)
...


which sure sounds like what you are looking for. Smile

Have a read, and see if there is anything there of use to you.
I'm sorry that I can't give you a more direct answer.
I hope this helps.
_________________
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
Back to top
View user's profile Send private message
haferbrei
Voice


Joined: 08 Apr 2020
Posts: 21

PostPosted: Mon Apr 19, 2021 4:40 pm    Post subject: Re: thread Reply with quote

willyw wrote:


I'm fuzzy on this - been a long time - but you can use the
open
command with pipes to deal with this.



i tried it with &, but it doesnt help at all. I get the message (!) timer drift -- spun 2 minutes
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber