Skip to content
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

Support observing Camera events #20

Open
Sija opened this issue Aug 10, 2016 · 2 comments
Open

Support observing Camera events #20

Sija opened this issue Aug 10, 2016 · 2 comments

Comments

@Sija
Copy link
Owner

Sija commented Aug 10, 2016

Like below:

camera.on :file_added do |event|
  # ...
end
@Sija Sija self-assigned this Aug 10, 2016
@Sija
Copy link
Owner Author

Sija commented Aug 11, 2016

I guess it would have to be sth along the lines of:

# Implemented somewhere inside of `Camera`
spawn do
  loop do
    event = wait timeout: 2000 # default, 2 sec
    event_name = event.type.to_s.underscore
    notify_listeners event_name, event
  end
end

Important questions/issues along the way:

  • is it needed? - YES, would come handy.
  • is it doable?
  • will it block the camera?
  • how big should be the timeout value?

@Sija Sija added the question label Aug 15, 2016
@Sija
Copy link
Owner Author

Sija commented Aug 15, 2016

https://github.com/krisleech/evented looks good for the job.

@Sija Sija added the idea label Aug 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant