It depends. As weird as it may sound, I'm still friends with my ex-BF from my high school years. We dated for 4 years. Probably the worst relationship I've been in.. but I still talk to him from time to time. i guess we still have the same sense of humor and sometimes we'll send each other random stuff. he lives far away now.
he even met my current boyfriend.. and it was all fine. I could never go back to him

so i think that's why i'm able to remain friendly with him