Can I run a code on a random (not current) user browser?

@russian-dima Thanks for your answer. You have guessed it correct, I would like to notify the recipient, who is logged in when a message is sent.

Actually I tried ‘checking the DB every x-seconds’ method, and it worked. I just thought it could be too abusive requests to DB, and there might be a more rational method, like an after-insert hook that only fires a code when a new message is created in a collection. I will check Real-Time API as well, thanks again!