とたん is the one that surprised you. 立ち上がったとたん、めまいがした — you stood up, and before you had any say in it your head swam. It reports, it never plans, and everything about it is fixed in the past: the verb in front takes the plain past form, and the clause behind it describes something that has already happened. A request or an intention after とたん is simply ungrammatical.
次第 faces the other way. It attaches to the masu-stem — 決まり次第, 到着次第 — and everything after it is still to come: ご連絡します, 出発しましょう, お知らせください. This is the one you meet in business email, and the promise it makes is precise: not soon, not later today, but the moment the thing is done.
や否や is what とたん looks like in a novel. ベルが鳴るや否や、教室を飛び出した. It takes the dictionary form, it needs both events to have actually happened, and it carries a slight breathlessness that suits narration and headlines. Say it in conversation and you sound like you are reading aloud.
か〜ないかのうちに is the pedantic one, and it earns its length. 家に着くか着かないかのうちに means you had barely arrived — the first action was still finishing when the second landed on top of it. Where とたん draws a line between two events, this one refuses to.