When the application to the court is made without notice to the party, and the writ be allowed, the alternative must be first issued; and if the application be upon due notice and the writ be allowed, the peremptory writ may be issued in the first instance. The notice of the application, when given, must be at least ten days. The writ cannot be granted by default. The case must be heard by the court, whether the adverse party appear or not.