Dynamic crossbeam select subscribing

so I encountered this issue and can't wrap my head around it. so the situation is as follows. I have a crossbeam Select and there is one receiver through which I receive certain "discovery" events and through those events I can "subscriber" to some kind of updates and I want to add them to this same select instance. The number of "discovery" events is unpredictable. The issue boils down to the question "where do I store these update receivers?" since select wants references to them and apparently it wants them to live as long as it lives (which is reasonable).

Many thanks for your help in advance and I am also open to suggestions of how to approach this differently

so I used arena (namely this crate GitHub - thomcc/rust-typed-arena: The arena, a fast but limited type of allocator) and it all works fine now

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.