Staying friends

Has it ever worked for anyone to stay friends with an ex they still have a lot of feelings for? My boyfriend and i are in the process of breaking up, but i can't stand to lose him as my best friend.