- Read every row in the table
- No reading of index. Reading from indexes is also expensive.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Respond extends Service[Request, Response] with Logger { | |
| def apply(request: Request) = { | |
| try { | |
| request.method -> Path(request.path) match { | |
| case GET -> Root / "todos" => Future.value { | |
| val data = Todos.allAsJson | |
| debug("data: %s" format data) | |
| Responses.json(data, acceptsGzip(request)) | |
| } | |
| case GET -> Root / "todos" / id => Future.value { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'celluloid' | |
| require 'open-uri' | |
| require 'cgi' | |
| require 'benchmark' | |
| module Enumerable | |
| def pmap(&block) | |
| futures = map { |elem| Celluloid::Future(elem, &block) } | |
| futures.map { |future| future.value } | |
| end |
NewerOlder