✅ Creating a collection similar to Channel/Queue that does not "remove" elements from the collection
I have a service in my bot which stores audit logs from Discord as they are relayed across the gateway. I want to store these in memory so that they can be accessed at any point, but I also want to preserve the audit logs as they come in (via a method that waits for an audit log meeting criteria). What are some options available to me?
I don't think I can use Channel or (Concurrent)Queue because they both "remove" elements from themselves as I consume them...unless there's a way to not do that?
1 Reply
Queue, for example, has both Peek and is enumerable so you can look at the elements inside without consuming them