native-platform icon indicating copy to clipboard operation
native-platform copied to clipboard

Allow latency deferring to be configured on macOS

Open lptr opened this issue 5 years ago • 0 comments

From FSEvents.h:

  /*
   * Affects the meaning of the latency parameter. If you specify this
   * flag and more than latency seconds have elapsed since the last
   * event, your app will receive the event immediately. The delivery
   * of the event resets the latency timer and any further events will
   * be delivered after latency seconds have elapsed. This flag is
   * useful for apps that are interactive and want to react immediately
   * to changes but avoid getting swamped by notifications when changes
   * are occurringin rapid succession. If you do not specify this flag,
   * then when an event occurs after a period of no events, the latency
   * timer is started. Any events that occur during the next latency
   * seconds will be delivered as one group (including that first
   * event). The delivery of the group of events resets the latency
   * timer and any further events will be delivered after latency
   * seconds. This is the default behavior and is more appropriate for
   * background, daemon or batch processing apps.
   */
  kFSEventStreamCreateFlagNoDefer = 0x00000002,

We should add the ability to enable/disable this via OsxFileEventFunctions.WatcherBuilder.

lptr avatar May 08 '20 12:05 lptr