-
Notifications
You must be signed in to change notification settings - Fork 124
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
Feat/debug elt buffer in worker mode #1438
base: dev
Are you sure you want to change the base?
Conversation
src/core/main/worker/worker_main.ts
Outdated
@@ -47,6 +47,8 @@ import { | |||
} from "./globals"; | |||
import sendMessage, { formatErrorForSender } from "./send_message"; | |||
|
|||
let shouldMonitorSegmentStoreUpdates = false; |
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.
I'm not really satisfied about the place this flag is declared, but I'm not sure where to put it while keeping same behavior
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.
What about another solution where it's the main thread who always request it (and decides of when to do it in some sort of interval)?
Kind of like a
-> ping
<- pong
system?
Though it also has its own drawbacks
src/main_thread/api/debug/render.ts
Outdated
parentElt.removeChild(debugWrapperElt); | ||
}); | ||
} | ||
|
||
renderDebugElement.__IS_USED = isUsed; |
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.
I'm not sure about this solution but I didn't want to change the API for createDebugElement
that return only a function for now.
In terms of logic it's working only if there is maximum 1 debug element at a time.
@@ -347,6 +381,89 @@ export default class SegmentSinksStore { | |||
} | |||
return true; | |||
} | |||
|
|||
public toSerialized() { | |||
const serializedSegmentSinksStore: SerializedSegmentSinksStore = { |
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.
This is an idea but maybe it's not better:
Instead of having a complex serialization, why not a totally ad-hoc solution where we would send an already-processed representation of the buffer graph?
Kind of like how we do for logs (which are also post-processed into the same graph than the debug element when using RxPaired).
This could be easier to maintain in a way if done well.
@@ -182,6 +185,7 @@ export default class MultiThreadContentInitializer extends ContentInitializer { | |||
}, | |||
{ clearSignal: this._initCanceller.signal, emitCurrentValue: true }, | |||
); | |||
this.trackDebugElementChanges(); |
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.
This wouldn't work if the debug element is shown during the content's playback no? (which seems to be most of the time on Canal+'s main application)
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.
It's working if the debug element is shown during content playback because this method track a SharedReference
that represent if the debug element is in use or not.
Just in case for users that might read that PR, by "worker mode" we mean here the For now we provide under that mode less information in the debug element that can be displayed when adding the optional |
This PR aims to add the segment inventory sink representation in the debug element of the RxPayer when it's working in worker mode.