Pudu programming language
Menu

Std.Http.Server.run

1 declaration

fn

run: &Std.Http.Server.Server -> &Std.Http.Server.Running -> Int -> Result[Int, Std.Http.Server.ServerError]

This is a callable function.

What it does

Accept connections into a bounded queue consumed by a fixed worker pool.

A connection is handled on its own thread, so one slow request does not

hold up every other client. That is the difference between a server and a

queue: without it, a handler that waits on a database stops the whole

program for as long as it waits.

`limit` bounds how many connections are accepted before the loop ends, so a

caller wanting one does not have to arrange to stop the server. A limit of

zero or less accepts until the server is stopped.

Read the signature

  • The text after the name is the type checked by Pudu.
  • Read arrows from left to right: inputs come first, and the final type is returned.
  • & borrows a value for this call instead of moving or copying it.
  • Names inside [ ] are type arguments, such as the item type held by a collection.
  • Result makes success and recoverable failure part of the function's type.

Back to Std.Http.ServerSearch related declarations