Skip to content
This repository was archived by the owner on Feb 7, 2020. It is now read-only.

Conversation

kirlat
Copy link
Member

@kirlat kirlat commented Jan 17, 2019

This is an implementation of @irina060981 suggestion: alpheios-project/components#308 (comment)

We already have a PsEventData object that contains a caller's class name. So the only addition required is the name of the caller function. I added this as a second argument to the pub() method. That's optional and can be omitted. This way we can use without the second argument it if a caller name tracking is not required and for compatibility with the existing code.

PsEventData object is passed to the callback function as a second argument, right after data. That would allow to use it as an optional arguments: callbacks that do not need this info can ignore it, others can use it.

I've also added a description getter that outputs event tracking information in a "human-readable form" of:
LexicalQuery.finalize -> [Lexical Query Complete]
(what was the caller and what was an event name)

Please let me know what do you think. Just want to offer this for discussion. I thought it would be easier to submit a PR than to describe everything in an issue. Thanks!

P.S. For alpheios-project/components#308

@kirlat kirlat requested a review from irina060981 January 17, 2019 14:45
Copy link
Member

@balmas balmas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me once the tests are fixed and updated :-)

Copy link
Member

@irina060981 irina060981 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it :)

@kirlat kirlat merged commit 84d97db into master Jan 18, 2019
@kirlat
Copy link
Member Author

kirlat commented Jan 18, 2019

@irina060981 This has been merged into master, so we can start using the improved tracking functionality

@kirlat kirlat deleted the pub-sub-event-source branch January 18, 2019 17:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants