The Messenger of Allah (ﷺ) went to Quba to offer prayer. Then the Ansar (the Helpers) came to him and gave him a salutation while he was engaged in prayer.

I asked Bilal: How did you find the Messenger of Allah (ﷺ) responding to them when they gave him a salutation while he was engaged in prayer. He replied: In this way, and Ja'far ibn Awn demonstrated by spreading his palm, and keeping its inner side below and its back side above.
Sunan Abi Dawud Book 2, Hadith 538