Like dolphins do
Dolphins have Unihemispheric slow wave sleep. That means that only one half of the brain is sleeping at the same time. In that way, they are able to maintain conscience during their "rest time". With a bit of handwavium/evolution, you could easily make this process a bit more efficiently, like splitting the sleep time into 4 brain hemispheres instead of 2...
Also, it doesn't need necessary to shut down a part of the brain. Several species, especially fishes, just slow down their metabolism (and brain activity) reducing a bit their activity
Even, some fishes like sharks can't sleep. They are able to store the memories gathered during the day without sleep. Note that sharks live in very "boring" areas, where there is very low activity, which means very low sensorial input => fewer things to memorize. If elves live in very "boring"/low-activity zones they could use this way. While sharks are "storing" or "saving" the gathered information during the day, the use to "shutdown" they sensorial input, to let brain work better.