Multiple listeners order subscribed to the same event?

Discussion forum for Extension Writers regarding Extension Development.
rxu
Extensions Development Team
Posts: 3363
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Name: Ruslan
Contact:

Re: Multiple listeners order subscribed to the same event?

Post by rxu »

First, developers can communicate to each other to resolve known incompatibilities with their exts. And this is what already happens in extensions in development forum I believe.
Second, Extension team could check (automatically f.e.) extensions for sharing same events and advice some prioritizing, and/or suggest exts authors to do that.
User avatar
david63
Registered User
Posts: 18064
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Contact:

Re: Multiple listeners order subscribed to the same event?

Post by david63 »

I agree in principle but in practice I cannot see that working.

Taking your first point - yes developers can communicate between themselves to try and resolve problems but only if they know that there is a problem as I would guess that in most cases they will not be aware of conflicting issues with extensions unless all extension developers have all extensions installed on a test board - which is not going to happen.

On the second point - it will become extremely time consuming for the Extension Team to check every event against every extension to see if there is a conflict. Some events (such as core.user_setup) will be used in many of the extensions and will not necessarily create any conflict when only loading a language file.
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored
User avatar
MattF
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 5175
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman
Contact:

Re: Multiple listeners order subscribed to the same event?

Post by MattF »

david63 wrote:That's fine when they are both your own extensions but how would you, or anyone else, handle it if they were written by two, or more, different developers?
Users who encounter any sort of conflicts will have to ask the extension's developers to get together and work it out amongst each other. Users are not shy about reporting issues the moment they are discovered.
rxu wrote:Second, Extension team could check (automatically f.e.) extensions for sharing same events and advice some prioritizing, and/or suggest exts authors to do that.
That's not going to be possible. All extensions will be sharing the same events, pretty much. The Ext Team tests extensions stand alone, to verify they work on their own, as advertised, inside of fresh installs of phpBB.
Formerly known as VSEMy ExtensionsPlease do not PM me for support.
User avatar
D@ve
Registered User
Posts: 143
Joined: Sat Aug 28, 2004 12:49 am
Location: Germany, Bretzfeld D.C.
Name: Dave Remmel
Contact:

Re: Multiple listeners order subscribed to the same event?

Post by D@ve »

I suggest two measures:

1) an incompatible operator in the migration file where you can define known extensions that are not working with your own, so that the extension won't install

2) a list of event values an extension need read/write access to. May be in form of another yml file.. perhaps optional in the first step (and mandatory after 3.2) So if two extensions access the same resource the admin can be warned during install

Regards, Dave
2jesus.de - (german community for bible & faith)
phpBB.de - the German support community for pbpBB
biosek
Registered User
Posts: 16
Joined: Sat Jan 31, 2015 2:57 pm

Re: Multiple listeners order subscribed to the same event?

Post by biosek »

Well If you won't need any harakiri like prioritize some events from one ext and some events from other ext, but only whole extensions.

Then the solution could be something like advanced settings in ACP->Customize->Manage Extensions for example toggleable column (for advanced administrators) with textbox in that colum to setup extension priority. Which would set priority of listeners and extension developers would stop arguing whose extension should have bigger listener priority.

I don't know if it could also solve problem with template priority, because i dont know anything about that.. yet. :)

Just throwing ideas.
rxu
Extensions Development Team
Posts: 3363
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Name: Ruslan
Contact:

Re: Multiple listeners order subscribed to the same event?

Post by rxu »

Prioritizing the whole extensions is rather senseless as you can easily face the case where some event subscriber from the ext#3 should be executed before the same event subscriber from the ext#1, but after the ext#2. This is just in theory for now, but certainly possible in the real life.
Post Reply

Return to “Extension Writers Discussion”