  Superconducting transition-edge sensors (TES) are extremely sensitive
microcalorimeters used as photon detectors with unparalleled energy resolution.
They have found application from measuring astronomical spectra through to
determining the quantum property of photon-number, $\hat{n} {=} \hat{a}^{\dag}
\hat{a}$, for energies from 0.6-2.33eV. However, achieving optimal energy
resolution requires considerable data acquisition -- on the order of 1GB/min --
followed by post-processing, which does not allow access to energy information
in real time. Here we use a custom hardware processor to process TES pulses
while new detections are still being registered, allowing photon-number to be
measured in real time as well as reducing data requirements by
orders-of-magnitude. We resolve photon number up to n=16 -- achieving up to
parts-per-billion discrimination for low photon numbers on the fly -- providing
transformational capacity for applications of TES detectors from astronomy
through to quantum technology.
