add ready? method to new plugin api
- Dominant language
- Java
- Stars
- 14.9k
- Forks
- 3.5k
- Avg merge
- 19h 14m
- Merged PRs (30d)
- 63
Description
as proposed/discussed in elastic/logstash-devutils#32 and elastic/logstash#3812 (now elastic/logstash#3895) I am moving here the discussion about potentially introducing a new `ready?` method which would mainly help for testing to know when the plugin is _ready_ and we can call the `stop` method on it.
there are a few things we should consider:
- it seems this new `ready?` method would only be used for tests/specs, in which case, is it really needed in a public api?
- it is hard de define the exact semantic of ready, is it ready once `register` has been called? or when the `run` method has been called? or when `run` has completed some internal initialization?
- in any cases, the `stop` method **should always be callable after `register` has been called**
- would the equivalent of the `stop` / `stop?` be sufficient? instead of a `ready?` we could just have a threadsafe`run?` method that just returns `true` when the `run` method has been called?
thoughts?
Contributor guide
Assessment
This issue has not been assessed yet.