Fibonacci
Constants
VERSION = "1.0.0"
Instance methods
fibonacci(x)
This implements an iterative solution to solving for a given fibonacci number. This function will also utilize BigInt, which is an arbitrary precision integer, if the answer will be too large to fit into a 64 bit Integer.
run
This example could be much shorter, but it represents a more typical application pattern, with handlers for managing errors, for logging responses, and for automatically compressing the response, if the request allows for it in the Accept-Encoding header.
wait
This is not strictly necessary, but in a larger application, one might want to have the main fiber wait for the fiber that is running the server to finish, and if it does so, cleanup resources. This pattern is a simple one to allow that.