Fast valve for ion beam-plasma interaction