Does giving your ex space really work?

I've recently split up with my boyfriend of 3 years. He decided to end it as he had stress for different reasons and said he just needed space to "help" him. Anyway, it is very hard for me to avoid the temptation of messaging him casually as I do really care about how he is feeling. But then I feel like completely avoiding all contact to help him heal. He said to me when we broke up, that we will more than likely get back together. Now for me, distance makes me lose interest and I honestly don't want that to happen. Will giving him space help him come back? Will he even miss me? Does it work?