What purpose do the barbarians serve in the society depicted? How are they a "kind of solution"?
In Cavafy's poem "Waiting for the Barbarians," we are shown a highly civilized but enervated and decadent society that anticipates an imminent attack from barbarians. The various elements of society -- the senators, the emperor, the consuls, the praetor, and the orators -- have all adapted themselves to barbarian conquest before the barbarians in question are anywhere near them, thinking not of resistance but only of the most elegant way to submit:
Why are they carrying elegant canes
beautifully worked in silver and gold?
Because the barbarians are coming today
and things like that dazzle the barbarians.
Readying itself for defeat, the imperial city is stunned by the unexpected news that not only are the barbarians not coming today, they are probably never coming at all:
....night has fallen and the barbarians have not come.
And some who have just returned from the border say
there are no barbarians any longer.
It is evident that the society of the poem has lost any purpose and is so bored that even destruction offers at least the charm of novelty. They may be "saved" at the end, but saved for what? The barbarians were "a kind of solution" because they would have made something happen; they were decisive and knew what they wanted. Without them, or something like them to impose direction and purpose, the over-cultivated people of the city are in danger of perishing from terminal boredom and purposelessness.