export player.NewContext function - #1358
Conversation
RestartFU
left a comment
There was a problem hiding this comment.
just curious, what do you need that for?
one of projects that I'm working on heavily relies on player.Context (for handling some stuff), it is useful cause you can call handler from other places |
|
can you show an example of this usecase |
seriously, what the hell are you even asking? didn't I explain clearly how this could be useful? or are you trying to teach me how to code? why am I the only one who gets questions like this? am I really that bad? |
|
dude you need to calm down i just wanted to see if this is something that can be solved a better way instead of exposing that internal method if you would rather have me not review your prs then ill let them sit, why are you being hostile over a simple question |
okay simple answer: |
|
|
okay this might need a different api which is why i asked for an example
dragonfly/server/player/context.go Lines 7 to 18 in 95c383e NewContext captures the transaction of the player, exposing it introduces footguns such as capturing the transaction of a stale player which will only panic once you call something like ctx.Block(..), and conflicts with "player.Context is valid only during its callback" which we documented. This was an explicit part of the new api design. A better design to expose might be |
we might call it |
No description provided.