Skip to content

ee/integration #183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 22 commits into from
Closed

ee/integration #183

wants to merge 22 commits into from

Conversation

mohitpubnub
Copy link
Contributor

  • WIP : getting listeners references for emitMessage and emitStatus

@mohitpubnub
Copy link
Contributor Author

wrong target

@mohitpubnub mohitpubnub reopened this Aug 3, 2023
@mohitpubnub mohitpubnub changed the base branch from master to eventengine/transition-unit-tests August 3, 2023 06:45
subscribeOperation.SubscribeListenerList = subscribeCallbackListenerList;
//subscribeOperation.CurrentPubnubInstance(this);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@budgetpreneur Do you think we will need this?

var emitMessageHandler = new Effects.EmitMessagesHandler(pubnubInstance, messageListener);
dispatcher.Register<Invocations.EmitMessagesInvocation, Effects.EmitMessagesHandler>(emitMessageHandler);

var emitStatusHandler = new Effects.EmitStatusEffectHandler(pubnubInstance, statusListener);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need link statusListener and messageListener with pubnubInstance ? Are we not instantiating SubscribeEventEngine per Pubnub instance.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pubnub reference was needed as all listener delegates signature are : (Pubnub instance, ...). So while calling those delegates along with data effect handler got, It has to pass pubnub instance reference along with it.
Other then that no other relation handler has with pubnub instance.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm referring this line

else {
var subscribeManager = new SubscribeManager2(pubnubConfig[InstanceId], JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this);
if (subscribeCallbackListenerList!= null && subscribeCallbackListenerList.Count > 0) {
messageListener = subscribeCallbackListenerList[0].Message;
Copy link
Contributor

Choose a reason for hiding this comment

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

subscribeCallbackListenerList[0].Message
Any reason for looking at only one listener?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

covered!

var subscribeManager = new SubscribeManager2(pubnubConfig[InstanceId], JsonPluggableLibrary, pubnubUnitTest, pubnubLog, telemetryManager, tokenManager, this);
if (subscribeCallbackListenerList!= null && subscribeCallbackListenerList.Count > 0) {
messageListener = subscribeCallbackListenerList[0].Message;
statusListener = subscribeCallbackListenerList[0].Status;
Copy link
Contributor

Choose a reason for hiding this comment

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

subscribeCallbackListenerList[0].Status
Any reason for looking at only one listener?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

covered!

savedSubscribeOperation = subscribeOperation;


subscribeEventEngine.eventQueue.Enqueue(new SubscriptionChangedEvent() { Channels = this.GetSubscribedChannels().ToArray(), ChannelGroups = this.GetSubscribedChannelGroups().ToArray() });
Copy link
Contributor

Choose a reason for hiding this comment

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

GetSubscribedChannels() and GetSubscribedChannelGroups() will be null at the first time.
Even I think, this is not the place in Pubnub.cs.
Can we move this code block inside SubscribeOperation2.cs (better name would be better)?

Copy link
Contributor

Choose a reason for hiding this comment

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

IMHO, Pubnub.cs is facade layer for all the operations that we want to expose to end users.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

WIP: finding more cleaner way!!!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@budgetpreneur If I expose getSubscribedChannels() in SubscribeOperation2 then It will be easy to get that info for eventEngine.
Because otherwise we need to pass something related to event engine into SubscribeOperation2.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@budgetpreneur please check last commit

Base automatically changed from eventengine/transition-unit-tests to eventengine-poc August 4, 2023 09:31
Copy link
Contributor

@MikeDobrzan MikeDobrzan left a comment

Choose a reason for hiding this comment

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

👌

@mohitpubnub mohitpubnub closed this Aug 7, 2023
@mohitpubnub
Copy link
Contributor Author

another PR is in place #185

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants