A Markovian event-based framework for stochastic spiking neural networks