yeah, you can put an expiration tag on any event kind and have it disappear if the relay allows it, so for this case you don't use ephemeral type, which are specified to not be stored

the actual implementation of expirations though, the "lazy" method that i have applied is simply that when it fetches an event from the db, if it reads an expiration that is passed, it doesn't include it and deletes it, but if nobody asks for it, it is just left there. to implement it dynamically so the event is deleted properly requires a scheduler and a worker thread that performs the action on a timer. this can be a lot more costly in terms of memory and processing if the relay does this a lot. there is probably a third approach that just does a routine scan every hour or so that would be a bit more of an in-between in terms of memory and processing cost.

Reply to this note

Please Login to reply.

Discussion

No replies yet.