In more contemporary settings, this weapon will appear as a cattle prod. They may also be used in Fantasy stories, appearing as Magic Staffs which fire or call down lightning.
This type of weapon is very common in Science Fiction where staff or baton-like weapons are used to shock prisoners as a way to pacify or torture them, though they may be used in open battle as well in short range or long range. Put simply, this is a stick or club with the power to fire or channel electricity.