rlauer6 / perl-Workflow-Inotify

inotify Perl workflow framework
2 stars 1 forks source link

Issue with automatic get_*/set_* #3

Open michal-josef-spacek opened 6 months ago

michal-josef-spacek commented 6 months ago

As I understand this automatic accessors are not useful.

When I have configuration:

[workflow_s3_uploader]
bucket        = foo
bucket_prefix = /biz
region        = us-east-1
host          = s3.amazonaws.com

The name workflow_s3_uploader means, that the system doesn't create an event handler for this name. Because no string with "watch_" prefix. This is working only for handle names like Watch::Foo and [watch_foo] name.

Could we improve this concept? I think "watch_" prefix is possible, but we need to remove the prefix in get_app_config().

rlauer6 commented 6 months ago

Not sure I understand the issue here? The method looks for a section name that is a derivation of your class name. So if you sub-classed this module as Workflow::S3::Uploader it would be looking for a section named workflow_s3_uploader.

Happy to modify the class if I can understand the issue in more detail.

Thank you for the input.

rlauer6 commented 6 months ago

I think I understand...

The intent was that [watch_ syntax in your ini file implied a handler for that directory. If you want to add a configuration object for your handler then you use the handler name in the ini file as a section name. Then when your handler is invoked, you have should have setters and getters for each variable in that section. Are you suggesting somehow conflating the two configuration sections into one?