Not really sure what to do

My ex and I were together for almost 5 years and yes during the course of everything, there were times where we hurt one another. I have a history of breaking up and getting back off of impulse. So here recently I broke up w him and was very mean to him when he tried to get back with me. When I came to my senses I realized how much I was a bitch to him and tried to win him back for abt a month now. He told me I always expect him to run back and he's not. He says he needs time and isn't feeling the relationship right now, but maybe in the near future we can try again. I just don't know what to do. On social media  he seems to enjoy the single life, but I'm not sure if it's just a front or not. I really hate being apart and am not sure if I should completely give up on us or just do my own thing for now and when he comes back sometime see if I'll take him back then. Idk this all is just very painful. What would you do?