-
Notifications
You must be signed in to change notification settings - Fork 7
/
RFDispatch.h
56 lines (43 loc) · 1.63 KB
/
RFDispatch.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*!
RFDispatch
RFKit
GCD helper
Copyright (c) 2012-2015, 2018 BB9z
https://github.com/BB9z/RFKit
The MIT License (MIT)
http://www.opensource.org/licenses/mit-license.php
*/
#import "RFRuntime.h"
#ifdef __BLOCKS__
/** Short version for dispatch_after.
@warning The block will be executed on main thread.
*/
API_AVAILABLE(macos(10.10), ios(6.0), tvos(9.0), watchos(2.0))
DISPATCH_EXPORT DISPATCH_NONNULL2 DISPATCH_NOTHROW
void dispatch_after_seconds(NSTimeInterval delayInSeconds, dispatch_block_t block);
/**
Submits a block object for execution on the main queue and waits until that block completes.
You can call this function on the application’s main thread and won’t results in deadlock.
*/
API_AVAILABLE(macos(10.10), ios(6.0), tvos(9.0), watchos(2.0))
DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
void dispatch_sync_on_main(dispatch_block_t block);
/**
Submits a block for asynchronous execution on the main queue.
*/
API_AVAILABLE(macos(10.10), ios(6.0), tvos(9.0), watchos(2.0))
DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
void dispatch_async_on_main(dispatch_block_t block);
/**
Submits a block for asynchronous execution on the global background concurrent queue.
*/
API_AVAILABLE(macos(10.7), ios(4.3), tvos(9.0), watchos(2.0))
DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
void dispatch_async_on_background(dispatch_block_t block);
/**
Create a dispatch_time_t using the specified time.
*/
API_AVAILABLE(macos(10.6), ios(4.0), tvos(9.0), watchos(2.0))
DISPATCH_EXPORT DISPATCH_WARN_RESULT DISPATCH_NOTHROW
dispatch_time_t dispatch_time_after_seconds(NSTimeInterval delayInSeconds);
#endif