Skip to content

Ways to run background jobs #4

Open

Description

@rguiscard

Is there an easy way to run background job (blocking or non-blocking is fine; maybe use fiber;) similar to ActiveJob in Rails? I understand it may not fit what mruby-shelf does, but it does provide some convenience. For example, a way to insert a middleware which will be called every 1 second or so. The simplehttpserver seems able to run in non-blocking mode, but I don't see how it works with mruby-shelf in non-blocking mode.

One use case that a mruby application periodically reads values from sensors (temperature, humidity, etc.) and provides a web interface for user. It keeps records of measurements for every second. Users can use web browser to get these records occasionally.

Thanks.

Activity

  1. katzer commented on Apr 30, 2024

    @katzer
    Owner

    Hi @rguiscard I see your use case but where's the connection between background jobs and mruby-shelf? The external webserver needs to listen in non-blocking mode, some background job can collect data independent of the lifecycle of the webserver and whenever a user requests comes in, the webserver will call the rack app to get the response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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