This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Eggdrop can just do one thing at once?

Old posts that have not been replied to for several years.
Locked
t
techie

Eggdrop can just do one thing at once?

Post by techie »

ive wrote an module that people can get infomation about a user.
the problem is that it have to wait to the other is finished before it could start on the another one if two user is requesting info at once.
how could i solve that?
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

This all depends how you go about doing things in the module. Is it a C module or Tcl script (whiles both are modules, due tot he fact, they plugin to eggdrop, wihtout being required in the first place).

How are you going about getting information about the user?

Is it information that is stored with the userfile, or is it obtained from another location?

If another location, how are you obtaining it, and can it be mass downloaded?

Eggdrop is not threaded, and as such, it can only do one task at a time, in the order eggdrop gets around to doing it.

It would all depend on where the infoormation is from and how you go about getting it. Once this is known, we can look at ways of queuing both curent and future requests.
M
M0dj0

Post by M0dj0 »

This is a very interresting topic for me aswell. In my case, my module keeps the information in an array with 10 elements. The information in the array is updated once every 24h. Users can type a trigger in a channel to get a print out of the information stored in the array.

I have the same issues that techie talks about. Any suggestions how to "speed" it up if multiple users use the trigger atonce ?

Hopefully it will be used in a channel with alot of people using it so some kind of "parallellism" would be nice to achive.

// M0dj0
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Eggdrop is not threaded, and can't run 2 commands at once.

It works using normal loops
LOOP START
checking incoming messages from the server
call each bind individualy based on incoming text
check incoming partyline activity
send some queued messages
clean somthing up
LOOP REPEAT
(Not very precise)

As such, eggdrop will only process one user message a time.

It's not likely to be a problem with speeding your code up, or making things work in any sort of paralel M0dj0.

This sounds more like the queues that it outputs too.

If on the first call to the script, it outputs 15 lines, the second time around, it add's another 15 lines.

As such, this is now 30 lines in the queue, which is run through one by one, in order.

As noted in another thread, you could, using your own code, find a way to get around this. But IRC servers class all text, globaly as a flood.

IE
They don't use 2 seperate flood couters, for different nicknames you are sending too.
So if the flood detector on the IRC server is set to 16 lines (not likely, it's just an example), simply outputting your 30 lines in the queue will flood you off, because the messages are counted globaly.
M
M0dj0

Post by M0dj0 »

Ok ... guess I cant do much about it, if I choose to be nice :). People just have to wait until the get served.

Thanx again ...

// M0dj0
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

It would be possible to do load ballancing, where you share the load between 2 or more bots.

The best method is using a linked botnet.

Instead of outputiing information to the server in the function called by the bind. You would have one bot, cycling through a list of bots, and informing them that they should output data tot he server.
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

M0dj0 wrote:This is a very interresting topic for me aswell. In my case, my module keeps the information in an array with 10 elements. The information in the array is updated once every 24h. Users can type a trigger in a channel to get a print out of the information stored in the array.

I have the same issues that techie talks about. Any suggestions how to "speed" it up if multiple users use the trigger atonce ?

Hopefully it will be used in a channel with alot of people using it so some kind of "parallellism" would be nice to achive.

// M0dj0
As ppslim explained for output messaging through an IRC server you are bound to the queue system of the bot and the penalty system of the IRC server.

There are other ways however to publish larger amounts of data. For example:
- upon a public trigger, open a DCC connection with the client, dump out the data and close the DCC connection.
- more or less the same as above: create a listening port where people can connect to with a telnet client and dump out the data there.
- let your bot create a web page and serve that one up with a http server. Or let the bot act directly as a http server.
- if most of the channel members sooner or later will request the data, instead of dumping out the data to a nick, dump it out to the channel.
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

If you're sending the same data to multiple users, you could set up a delay so that when someone types your trigger, it waits 15 seconds before it starts sending. Then if someone else types it before then, it just sends the same privmsg to both people (a lot lower penalty).

It's hard to say how you should optimize it without knowing what the data is, though.

The dcc chat is probably the most versatile idea, since you can send basically an unlimited number of lines, with only a few second delay on the server (privmsg to establish chat). Of course a file send would work as well.
M
M0dj0

Post by M0dj0 »

This proposal of opening a dcc connection sounds interresting.

stdragon: You can find an example of the data in my module in the thread "Speedup of printout".

stdragon, egghead: I would be very greatfull if it would be possible for You to help me with just and example of how to establish a dcc connection with the client. Please post it in the thread "Speedup of printout", since thats the most appropriate one for this matter.

Thanks in advance.

// M0dj0
Locked