While you may think that actors find out about roles from agents or managers, it can also happen where they find out they've been offered something pretty much the same time as you.
Case in point is Samuel L. Jackson and the sequel to M. Night Shyamalan's excellent thriller, 'Unbreakable', that was teased at the end of 'Split' with James McAvoy. As he tells it in a recent interview with Vulture, he found out the same way you did. "I remember when Night called me last year to say, ‘I need you to watch this movie I just made, and after you watch it, I’ll tell you what I’m thinking.’ So I watched Split, and at the end of it, we get Bruce in the café and the woman talks to him about Mr. Glass."
Jackson explained that the future of 'Glass' depended on how 'Split' did in the opening weekend - and, as we already know, it did gangbusters and made $278 million worldwide against a production budget of $9 million - so naturally, that was all the impetus they needed for it to happen.