/** * @since Available in iOS 4.0 and later. */ public void apply(long iterations, VoidBlock1<Long> block) { apply(iterations, this, block); } /**
/** * Submits the specified {@link Runnable} on this {@link DispatchQueue} at * the specified time. * * @param when the time when to submit the {@link Runnable}. * @param block the {@link Runnable} to be run. * * @since Available in iOS 4.0 and later. */ public void at(Date when, Runnable block) { long ms = when.getTime(); timespec ts = new timespec(ms / 1000, (ms % 1000) * 1000); after(Dispatch.walltime(ts, 0), this, block); } /*<methods>*/
public timespec(@MachineSizedSInt long tv_sec, @MachineSizedSInt long tv_nsec) { this.setTv_sec(tv_sec); this.setTv_nsec(tv_nsec); } /*</constructors>*/
/** * @since Available in iOS 4.0 and later. */ public static void once(Runnable block) { MachineSizedSIntPtr ptr = new MachineSizedSIntPtr(); once(ptr, block); } /*<methods>*/
private void reachabilityChanged(SCNetworkReachabilityFlags flags) { if (reachabilityListener != null) { if (isReachableWithFlags(flags)) { reachabilityListener.onReachable(this); } else { reachabilityListener.onUnreachable(this); } reachabilityListener.onChange(this, flags); } // this makes sure the change notification happens on the MAIN THREAD DispatchQueue.getMainQueue().async( () -> NSNotificationCenter.getDefaultCenter().postNotification(REACHABILITY_CHANGE_NOTIFICATION, this)); }
public NetworkReachability(SCNetworkReachability reachability) { Objects.requireNonNull(reachability, "reachability"); this.reachability = reachability; reachableOnWWAN = true; // We need to create a serial queue. // We allocate this once for the lifetime of the notifier. reachabilitySerialQueue = DispatchQueue.create("org.robovm.pods.reachability", null); }
/** * Submits the specified {@link Runnable} on this {@link DispatchQueue} at * the specified time. * * @param when the time when to submit the {@link Runnable}. * @param block the {@link Runnable} to be run. * * @since Available in iOS 4.0 and later. */ public void at(Date when, Runnable block) { long ms = when.getTime(); timespec ts = new timespec(ms / 1000, (ms % 1000) * 1000); after(Dispatch.walltime(ts, 0), this, block); } /*<methods>*/
public timespec(@MachineSizedSInt long tv_sec, @MachineSizedSInt long tv_nsec) { this.setTv_sec(tv_sec); this.setTv_nsec(tv_nsec); } /*</constructors>*/
/** * @since Available in iOS 4.0 and later. */ public void apply(long iterations, VoidBlock1<Long> block) { apply(iterations, this, block); } /**
/** * @since Available in iOS 4.0 and later. */ public static void once(Runnable block) { MachineSizedSIntPtr ptr = new MachineSizedSIntPtr(); once(ptr, block); } /*<methods>*/
/** * Submits the specified {@link Runnable} on this {@link DispatchQueue} at * the specified time. * * @param when the time when to submit the {@link Runnable}. * @param block the {@link Runnable} to be run. * * @since Available in iOS 4.0 and later. */ public void at(Date when, Runnable block) { long ms = when.getTime(); timespec ts = new timespec(ms / 1000, (ms % 1000) * 1000); after(Dispatch.walltime(ts, 0), this, block); } /*<methods>*/
public timespec(@MachineSizedSInt long tv_sec, @MachineSizedSInt long tv_nsec) { this.setTv_sec(tv_sec); this.setTv_nsec(tv_nsec); } /*</constructors>*/
/** * @since Available in iOS 4.0 and later. */ public void apply(long iterations, VoidBlock1<Long> block) { apply(iterations, this, block); } /**
/** * @since Available in iOS 4.0 and later. */ public static void once(Runnable block) { MachineSizedSIntPtr ptr = new MachineSizedSIntPtr(); once(ptr, block); } /*<methods>*/