omnata-plugin-runtime 0.4.2a96__tar.gz → 0.4.3__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: omnata-plugin-runtime
3
- Version: 0.4.2a96
3
+ Version: 0.4.3
4
4
  Summary: Classes and common runtime components for building and running Omnata Plugins
5
5
  Author: James Weakley
6
6
  Author-email: james.weakley@omnata.com
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "omnata-plugin-runtime"
3
- version = "0.4.2-a96"
3
+ version = "0.4.3"
4
4
  description = "Classes and common runtime components for building and running Omnata Plugins"
5
5
  authors = ["James Weakley <james.weakley@omnata.com>"]
6
6
  readme = "README.md"
@@ -1126,6 +1126,16 @@ class InboundSyncRequest(SyncRequest):
1126
1126
  Sets the record count for a stream, used to provide progress updates.
1127
1127
  """
1128
1128
  self._stream_record_counts[stream_name] = count
1129
+
1130
+ def set_stream_total_records_estimate(self, stream_name: str, count: int):
1131
+ """
1132
+ Sets the total record count for a stream, used to provide progress updates.
1133
+ This should be a best estimate of the number of changes which will be fetched from the source.
1134
+ In other words, as results are enqueued they should build toward reaching this number as the sync progresses.
1135
+ This does not have to be exact, it's just to give the user some feedback while the sync is running.
1136
+ Totals will always be replaced by the actual count when the stream is completed.
1137
+ """
1138
+ self._total_records_estimate[stream_name] = count
1129
1139
 
1130
1140
  def _enqueue_state(self, stream_name: str, new_state: Any):
1131
1141
  """
@@ -218,7 +218,9 @@ class PluginEntrypoint:
218
218
  inbound_sync_request.update_activity("Staging remaining records")
219
219
  logger.info("Calling apply_results_queue")
220
220
  inbound_sync_request.apply_results_queue()
221
+ logger.info("Calling apply_rate_limit_state")
221
222
  inbound_sync_request.apply_rate_limit_state()
223
+ logger.info("Calling apply_progress_updates")
222
224
  inbound_sync_request.apply_progress_updates()
223
225
  if inbound_sync_request.deadline_reached:
224
226
  # if we actually hit the deadline, this is flagged by the cancellation checking worker and the cancellation