
There was a thread on the forums of a Minecraft server I frequent which was discussing trying to make a rather complicated gate system for a series of railways that would lead to various location within the server. I like the look and feel of multiple entry ways as opposed to a single programmable entry way, but the problem did arise that they needed a way to keep the lines going in one direction. If another player is on the tracks heading in the opposite direction, the system bottlenecks.
Here is my first, rather painful attempt at a solution:
I found out serendipitously that players can go through blocks that would otherwise stall them as long as they are riding a mine cart at significant speed. And with the introduction of the Powered Rail and the Detector Rail, you can use the above information to make a brake one direction and a boost the other. A player who enters this gate from the side with the Detector Rail first (in this case, the left side) will hit the Detector Rail, which powers the Powered Rail and boosts them through. Anyone entering from the other direction will brake when crossing an unpowered Powered Rail.
I feel the overhanging blocks are necessary, because otherwise someone could just walk beyond the brake and render the brake system useless. Players will take very minor damage when crossing the low hanging blocks, so that needs to be taken into account.