StackExchange / StackExchange.Redis

General purpose redis client
https://stackexchange.github.io/StackExchange.Redis/
Other
5.87k stars 1.51k forks source link

[Question] byte array or Memory<byte> and FireAndForget message #2536

Closed rayao closed 1 year ago

rayao commented 1 year ago

When RedisValue payload is byte[] (or Memory), and CommandFlags.FireAndForget is set, is there any way to know when it's safe to touch the byte[] content? For example, if the byte array is rented from ArrayPool, how do I know when to return it back to the pool? Or maybe in this case it's not recommended to use FireAndForget?

mgravell commented 1 year ago

Don't use fire and forget in this scenario.

rayao commented 1 year ago

Thank you @mgravell