The current government shutdown is now the longest in history by a fairly wide margin. President Trump and Democratic leadership in Congress both remain intransigent on the question of funding for a border wall. There is no obvious end to it in sight, but that doesn't mean that, barring some extraordinary — and perhaps not entirely unwelcome — contingency, like the end of the world, it will go on forever. The question is how and when it will end. Here are some possible scenarios.

1. Trump declares a state of emergency

The president himself has mused before about the possibility of declaring a national emergency and appropriating funds for the wall from the military budget. Indeed, many observers thought he might consider doing so weeks ago. It is difficult to understand what has prevented Trump from following the advice of Sen. Lindsey Graham (R-S.C.) and others. It could be that he has been briefed on the considerable legal obstacles that lie between such a declaration and any actual construction-related activity — though there is bound to be a great deal of back-and-forth lawyering over property concerns and other issues if funds are ever found for building the wall, regardless of the specific mechanism. It could also be the case that Trump wishes to avoid an intra-party feud about the use of executive power, a broad view of which some of his GOP critics only seem willing to entertain when it comes to torture.

2. Trump finds a creative rhetorical solution to his wall problem

Who knows? Maybe Trump has his picture taken with part of the border fortifications that already exist and decides to start insisting that we already have a wall. Maybe he talks with some very smart people (very, very smart, okay?) and decides that the best possible wall would be an invisible cyber-wall powered by block-chain drone technology or some other buzzword that aides could insert into his remarks. He could also suddenly announce that construction on the wall is awaiting the ratification of the revised trade agreement with Canada and Mexico, whose check needed to clear before making a down payment on one of the most extensive infrastructure projects in American history. Or he could do all of these things at once.

3. The Democrats give in

There are already signs that moderate Democrats — including a handful of those who represent congressional districts that Trump won in 2016 — are growing weary of the present stalemate. They do not relish the prospect of having to explain to their constituents that, yes, the president is technically correct when he says the government could have been opened at any time in the last several weeks if they had only agreed to fund a project that most members of their party's leadership supported not very long ago. It seems unlikely to me, though, that Nancy Pelosi (D-Calif.) would make such a radical concession so early in her second tenure as speaker of the House.

4. Trump reaches some kind of meaningful compromise with the Dems

Imagine a deal that would both fund the wall at the level Trump has requested and entice Democratic leadership — by providing green cards to 700,000 participants in the Obama-era DACA program, for example. While it would be interesting to see how Pelosi and Senate Minority Leader Chuck Schumer (D-N.Y.) would respond to this sort of baiting — Trump would never shut up about how they voted "against" DACA and the beautiful DREAMers — it is hard to envision an idea like this being seriously proposed by the White House, much less entertained in the Senate and embraced by the president's base. Ann Coulter would probably self-deport to Iceland.

5. Trump and Democrats make a deal following some kind of crisis

If something like an unexpected natural disaster or a major terrorist attack were to take place, it is easy to imagine a deal that somehow elided the question of funding for the wall being reached immediately. Needless to say this is not an outcome anyone is hoping for. It would the governing equivalent of waiting for your rich and very sweet uncle to die in order to pay your electric bill even though you have more than enough money in your checking account.

6. A legal challenge is brought against the shutdown

It could take years for a case with even a moderately successful chance of success to make its way to the Supreme Court, where such a thing would ultimately be decided. Lawsuits such as those brought on behalf of federal workers being asked to report to their jobs without being paid will, however, probably have important ramifications for the next government shutdown.

Of course, there's the possibility that the shutdown goes on forever. Or at least until Trump is out of the White House. If you are more bullish than I am about the prospects for the president's impeachment and removal from office, this is not quite out of the question. Ditto if you think he is going to be a one-term president. The idea that the government may not be fully funded until January 2021 is absurd, almost unimaginable, but then again, so is this presidency.