--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/022c3632-4637-4cc5-bd37-8fe1a4a91127%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2x2DcD%2BH20eN95-WqbzErLFKAsrBueYvyy1F1tzsx71A%40mail.gmail.com.
Hey there, this is already a thing. No need to reinvent the wheel.
http://en.wikipedia.org/wiki/Futures_and_promises
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/3f753ec7-1cc8-4d59-8671-8bf7ebdb3ccd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOC0O9cVh29_ic7O95NLC21PqRVvyDY265%2BhuHBZbxZGbw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA11R-UEnWf5DUCHz%2B_KuYJn1Sx66K7CPD3uZFbsJR7VqQ%40mail.gmail.com.
If I understand correctly, you want to define how a particular object (the subject, using your vocabulary) can notify another (observer) of an event, have the observer take some action, and then return some thing as a result.
I understand that decoupling the subject from the observer could appealing, so that you can call any function provided by observer when an event occurs. (And possibly provide logic inside the request to route the event to one of many possible functions inside the observer)
However, I think this particular implementation would cause more issues than it solves.
For instance, in the case that a third object wires a subjects event to the wrong method the observer, and some exception thrown the observers method. In this case, my stack trace will show that the subject called the observer, and that an exception was shown.
A developer would then spend time tracking down where these calls happened, only to not find anything wrong. They would have to know that object 3 wired the event, and only upon looking at the code in object 3 would they find the bug.
This makes the code a maintenance nightmare. Especially if the maintainer didn't write the code.
And I'm all for making maintainers lives easier.
Secondly, this means that an object does not fully control what it's response is to an event.
I am of the mind that an object should explicitly define its behaviour to events.
Have you considered using event handlers?
Observers must satisfy an interface that the subject can call directly, making maintenance easier.
Also, the observer then is in full control over what happens in response to the event.
Finally, a subject is then able to provide subscribe/unsubscribe functionality to allow dynamic routing of events to different observers.
Turns out that wasn't so brief after all.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/585f7e11-45ba-401a-a533-6811a3c0069d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Same with future, promise, you can achieve both async and sync behavior, its really up to caller to decide. I often use future/promise just to limit a particular operation on a server to only a couple threads. The end result is people call a completely synchronous function.
It seems like this pattern is just a poor mans version of something that already exists. I guess my confusion comes from all the time/energy your putting into documenting it.
Here is another source of a sync messaging API that is core to iOS, invented in the 1970s.
http://www.apeth.com/iOSBook/ch03.html
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/afaf0ed7-58e1-4379-9b2f-d3828fb7f75e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Sorry, I'm just confused as to why your taking some concept people have been doing for 40 years and making an "RFC" for it. I applaud your enthusiasm though. I wish I put as much effort into documenting.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/3a3fd118-0723-4d87-b9a8-2d3095c8f193%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
In an attempt to reinterpret Matt's comments to reflect my own thoughts, the way it appears to me is that the RFC is a very abstract description of an implementation that wraps existing concepts. It positions itself as if it is proposing something new, but I am not clear on the existing problems that are not properly solved, and what your idea is really aiming to change. That would be in terms of real concrete problems that need to be solved, instead of saying a button might need to trigger something that may or may not exist and it may or may not require a response either now or at some point in the future. Otherwise I am not sure what the RFC is aiming to do. It comes across more as a brainstorm for how to write your own implementation of some Python program, as opposed to saying there is a new way to do something. What specific problem do you want to solve? What have you tried that has failed to meet your needs?
That is why I feel you are receiving criticism on the topic. I don't see it as trolling. I see it as people challenging that it is a solid topic. Not all criticism has to include contributions that will further your design. Sometimes some people just don't get the goal and the intent. And that's ok. While you say sync/async is not the focus, maybe then it's not as clear as you had hoped, if commentors are focusing on the topics you didn't intend to discuss.
My 2 cents.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCq8SuanVGOAuuVhVntTn8wXL9vpw3kQSJFxQOxGLru_Q%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2yAtNG5UM%2Bnvc22Rs29TmUwzgxuij1Um21_eU5rx%2BnfQ%40mail.gmail.com.