You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Host apps requiring even more customized behaviour could register a callable
JobIteration.configuredo |config|
config.on_cursor_unsafe_to_serialize=lambdado |job,cursor|
# e.g. compare job against some list and conditionally raise# e.g. emit a metric to some metric serviceendend
This could be shipped as part of a minor version bump, as it would be a non-breaking new feature intended to provide more robust guarantees.
When we decide it is appropriate to change the default, we can simply change it and release a major version bump. Consumers could continue to override the config until such a time as we decide to get rid of it.
The text was updated successfully, but these errors were encountered:
I think I'd just go with a deprecate current behavior and in the next version remove it. If apps want to deal with complex objects they can do directly in the caller. I don't think we need a configuration for this.
D=ActiveSupport::Deprecation.new('2.0','JobIteration')D.deprecation_warning(:build_enumerator,'unsafe cursor message...')# DEPRECATION WARNING: build_enumerator is deprecated and will be removed from JobIteration 2.0 (unsafe cursor message...) (called from <top (required)> at /opt/rubies/2.6.5/lib/ruby/gems/2.6.0/gems/irb-1.0.0/exe/irb:11)
Context
The enforcement that cursors be losslessly serializable to JSON introduced in #73 was released in
1.1.11
.Unfortunately, this broke some production jobs, due to excessive mocking in tests not catching unserializable cursors.
We have since reverted the change in #77 and published version
1.1.12
.This was discussed in Slack:
Way Forward
We could reintroduce the cursor validation, but this time with behaviour customizable by the host app.
Rails.logger.warn
.This could be shipped as part of a minor version bump, as it would be a non-breaking new feature intended to provide more robust guarantees.
When we decide it is appropriate to change the default, we can simply change it and release a major version bump. Consumers could continue to override the config until such a time as we decide to get rid of it.
The text was updated successfully, but these errors were encountered: