-
Notifications
You must be signed in to change notification settings - Fork 11
Add priority parameter #10
base: master
Are you sure you want to change the base?
Conversation
$a = $this->_priorities[$a]; | ||
$b = $this->_priorities[$b]; | ||
|
||
/*if (70000 <= PHP_VERSION_ID) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, remove this comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, first try to make compatibility with spaceship operator but it's parser issue.
@Hywan After a bunch of test the big deal with Otherwise we can still create our own class with ArrayAccess and Iterator pattern for have consistent solution. This should be part of |
@Pierozi The best solution would be to create the |
That could be good, but that must be a super What thinks the others @hoaproject/hoackers ? |
From a pure architectural point of view, I think that creating a |
@Pierozi Create your own library, and we will fork it after. |
FYI, development in progress in repo https://github.com/Pierozi/HoaHeap |
Nice :-). I don't know how we can do the tracking of the progression. How would you be comfortable? |
I guess the best should create empty repo and then I can do a PR, because fork my repo is not good idea repo should belong to Hoa. Or we can just define an issue on my repo until community agree with library. |
@Pierozi I think the second solution is the best for now. |
The code of library are finished with the support of Min and Max, as common Heap does, and the performance / quality satisfies me. I need write api explication and demo in Readme. There is the issue Pierozi/HoaHeap#6 @hoaproject/hoackers reviews always welcome. |
Hello,
I wrote this PR first before any issue because i had to write this patch for move forward on customer project.
I don't know if the state of art is good enough, but seems good to expose as a PR.
My case : I use
Hoa\Exception
and the power of event for handle correctly the translation of exception into a dedicated Library. But then i use this library into an App, and this app need be able to plug his own callable before library for catch specific exception and throw another dedicated to the library.My solution was to add an integer argument to
attach
method for define priority level, higher is most important and called first.https://continuousphp.com/git-hub/Pierozi/Event/build/6019f777-ed30-4923-882e-42a213021ff0/output