Eventghost instance per user session or as is

Got a good idea? You can suggest new features here.
Post Reply

Allow EventGhost to run per user session instead of per computer

Poll ended at Sat May 26, 2018 6:19 pm

New instance of EG per user login
Keep the same
I have no clue what you are mumbling about
No votes
Total votes: 2

User avatar
Site Admin
Posts: 5498
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Eventghost instance per user session or as is

Post by kgschlosser » Thu Apr 26, 2018 6:19 pm

OK so let me break this down.

I have discovered a means to be able to allow for Eventghost to run multiple copies at the same time. Now I know this is an available option via the command line via the -multiload command line switch. But this will function a bit differently.

OK so here goes.

Right now EG is set to run in the global namespace. basically one instance per computer doesn't matter what user is signed on. (or ran as). Since we have updated EventGhost to be more user aware and all of the startup goodies are save into the logged in users profile it is now possible to run more then one copy of EventGhost at the same time without them bumping heads. Kind of. You would not be able to share network ports or com ports. things of that nature. and you would have to be careful about causing loops. as an example have the 2 running instances of EG fight over what to set the sound volume to. Tho this would be very amusing to watch and you could place bets on which one would win, I do not think your computer would like it all that much.

But it would give EG a whole lot more flexibility. The reason i state this is because of the current event system setup. Since EG is only able to process events one at a time. you could now have multiple trees running at the same time and each processing their own events.

It can get very involved by means of sending commands between them by use of the named pipe. The coding is a bit complex and I would make use of random GUID's to identify who was what and I would probably want to set up some kind of a named pipe server service that would handle the various eventghost instances so you could forward data between the running EG's. This would also be a means to implement a proper watchdog. in the event of an EG crash/hang the service would be able to kill the hung EventGhost session and spawn a new one.

I would have to disable the -multiload if this was something that is wanted. By use of Fast User Switching or using the runas command you can run a copy of EG for a specific username.

HELLO Remote Desktop!!! so this is an awesome thing for Remote Desktop sessions. there is a registry hack that will allow windows to allow more then a single session when using Remote Desktop.

Because of how we designed the named pipe an Administrative plugin could be made where you would install the plugin into a single copy of EG and a client plugin into the rest. it would give you all of the abilities that would have as if you were directly using that instance of EG.

so here is a little flow chart

Code: Select all

EG named pipe service
       Mike - EG Session 1 - Pioneer Network Plugin - Client Plugin
        Bob - EG Session 2 - Serial Plugin - Client Plugin
      Felicity - EG Session 3 - PC Sound - Client Plugin
       Chico - EG Session 4 - Administrative Plugin

Now this is very crude. The biggest thing that will have to be tackled is a way to prevent accessing the same resources. like a com port or a network port. But through the use of the Named Pipe server each instance (so long as the administrative/client plugin is installed) would be able to make calls to each of the actions located in the different running copies of EG. I designed the multi-threaded event system which is a great idea but it had one very large flaw. what happens if 2 things happen to the same device at the same time.... hmmm.... unexpected results. By use of this system we stick to the single event thread. and when a command comes in via the named pipe an event gets triggered that the one session has to process. this will remove the problems associated with multiple actions being performed on the same device at the same time.

Now this is an example of what can be done and not what will be done. But it is the proverbial foot in the door to getting EG to run as a service. also... FYI Named pipes are also network resources. so the world of EG would then have the potential to be a client server application.
If you like the work I have been doing then feel free to Image

Post Reply