Skip to content
This repository was archived by the owner on Oct 7, 2025. It is now read-only.

future/async doesn't seem to be async #76

@fkchang

Description

@fkchang

Hi. I'm not sure if I'm using this right, but shouldn't these be handled asyncrhonously?

require 'angelo'

class HelloApp < Angelo::Base

  task :do_stuff do
    time_of_request = Time.now
    Kernel.sleep 10
    time_after = Time.now
    "Hello to you, too. #{time_of_request}- #{time_after}"
  end

  get "/" do
    puts "processing"
    f = future :do_stuff
    f.value
  end
end

HelloApp.run!

When I hit it, they are usually serviced 10 sec apart. Occasionally one gets serviced w/in 3 sec.

Perhaps I did not use future correctly? Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions