Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streaming in before filter #1901

Closed
kyleqian opened this issue Mar 9, 2023 · 0 comments
Closed

Streaming in before filter #1901

kyleqian opened this issue Mar 9, 2023 · 0 comments
Labels

Comments

@kyleqian
Copy link

kyleqian commented Mar 9, 2023

Hello! Is it possible to start streaming responses in a before filter? I wasn't able to get it working in a fresh app.

class MyApp < Sinatra::Base
  get '/' do
    'Hello world!'
  end

  before do
    stream do |out|
      out << 'BEFORE EVERYTHING ELSE'
    end
  end
end
@sinatra sinatra locked and limited conversation to collaborators Mar 9, 2023
@dentarg dentarg converted this issue into discussion #1902 Mar 9, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

2 participants