1[package]
2name = "ylong_runtime"
3version = "1.0.0"
4edition = "2021"
5description = "Runtime Environment"
6license = "Apache-2.0"
7repository = "https://gitee.com/openharmony/commonlibrary_rust_ylong_runtime"
8keywords = ["ylong", "runtime", "executor"]
9
10[features]
11default = []
12
13full = [
14    "net",
15    "multi_instance_runtime",
16    "current_thread_runtime",
17    "signal",
18    "sync",
19    "time",
20    "process",
21    "fs",
22    "macros",
23]
24
25ffrt_full = [
26    "net",
27    "signal",
28    "sync",
29    "time",
30    "process",
31    "fs",
32    "ffrt",
33    "macros",
34]
35
36# This feature controls the executor type runs below the runtime.
37# If turned off, ffrt executor will be selected.
38# If turned on, ylong executor will be selected.
39ffrt = ["ylong_ffrt"]
40
41# This feature controls whether the runtime is singleton.
42# If turned on, there could be mulitple executors running with their own thread pool.
43multi_instance_runtime = []
44
45# This controls whether to enable the functionality to turn the current thread into a single-thread runtime.
46current_thread_runtime = []
47
48# Async file io components
49fs = ["sync"]
50
51# Coroutine synchronization components (mutex, channel, etc.)
52sync = []
53
54# Timer component
55time = []
56
57# Async IO components
58net = ["ylong_io/tcp", "ylong_io/udp"]
59
60# Signal component
61signal = ["ylong_signal", "net", "sync"]
62
63# Macro components
64macros = ["ylong_runtime_macros"]
65
66# Metrics component
67metrics = []
68
69# Process component
70process = ["signal"]
71
72[dependencies]
73libc = "0.2.134"
74ylong_signal = { path = "../ylong_signal", optional = true }
75ylong_io = { path = "../ylong_io", optional = true }
76ylong_ffrt = { path = "../ylong_ffrt", optional = true }
77ylong_runtime_macros = { path = "../ylong_runtime_macros", optional = true }
78
79[dev-dependencies]
80tokio = { version = "1.25", features = ["full"] }
81
82[package.metadata.doc.rs]
83all-features = true
84rustdoc-args = ["--cfg", "docrs"]
85
86[[bench]]
87name = "ylong_tokio_mutex"
88path = "benches/ylong_tokio_mutex.rs"
89required-features = ["sync"]
90
91[[bench]]
92name = "ylong_tokio_rwlock"
93path = "benches/ylong_tokio_rwlock.rs"
94required-features = ["sync"]
95
96[[bench]]
97name = "ylong_tokio_tcp"
98path = "benches/ylong_tokio_tcp.rs"
99required-features = ["net"]
100
101[[bench]]
102name = "ylong_tokio_udp"
103path = "benches/ylong_tokio_udp.rs"
104required-features = ["net"]
105
106[[bench]]
107name = "ylong_tokio_uds"
108path = "benches/ylong_tokio_uds.rs"
109
110required-features = ["net"]
111
112[[bench]]
113name = "ylong_tokio_multi_threaded"
114path = "benches/ylong_tokio_multi_threaded.rs"
115required-features = ["net"]
116
117[[example]]
118name = "ylong_runtime_tcp_client_perf"
119path = "benches/bin/ylong_runtime_tcp_client_perf.rs"
120required-features = ["net", "multi_instance_runtime"]
121
122[[example]]
123name = "ylong_runtime_tcp_server_perf"
124path = "benches/bin/ylong_runtime_tcp_server_perf.rs"
125required-features = ["net", "multi_instance_runtime"]
126
127[[example]]
128name = "ylong_runtime_async_benchmark"
129path = "benches/bin/ylong_runtime_async_benchmark.rs"
130required-features = ["net", "multi_instance_runtime"]
131
132[[example]]
133name = "ylong_sync_mutex_perf"
134path = "benches/bin/ylong_sync_mutex_perf.rs"
135required-features = ["sync"]
136
137[[example]]
138name = "ylong_sync_rwlock_perf"
139path = "benches/bin/ylong_sync_rwlock_perf.rs"
140required-features = ["sync"]
141
142[[example]]
143name = "ylong_runtime_tcp"
144path = "./examples/ylong_runtime_tcp.rs"
145required-features = ["net"]
146
147[[example]]
148name = "ylong_runtime_signal"
149path = "./examples/ylong_runtime_signal.rs"
150required-features = ["signal"]
151
152[[example]]
153name = "ylong_runtime_multi_runtimes"
154path = "./examples/ylong_runtime_multi_runtimes.rs"
155required-features = ["multi_instance_runtime"]
156
157[[example]]
158name = "ylong_runtime_memory"
159path = "examples/ylong_runtime_memory.rs"
160required-features = ["multi_instance_runtime"]
161
162[[example]]
163name = "ylong_runtime_timer_sleep"
164path = "examples/ylong_runtime_timer_sleep.rs"
165required-features = ["time", "multi_instance_runtime"]
166
167[[example]]
168name = "ylong_runtime_timer_memory"
169path = "examples/ylong_runtime_timer_memory.rs"
170required-features = ["time", "multi_instance_runtime"]
171
172[[example]]
173name = "ylong_timer_latency"
174path = "examples/ylong_timer_latency.rs"
175required-features = ["time"]
176
177[[example]]
178name = "ylong_runtime_tcp_fd_limit"
179path = "examples/ylong_runtime_tcp_fd_limit.rs"
180required-features = ["net"]
181
182[[example]]
183name = "ylong_runtime_spawn_fail"
184path = "examples/ylong_runtime_spawn_fail.rs"
185required-features = ["time"]
186
187[[example]]
188name = "ylong_timer_out_of_context"
189path = "examples/ylong_timer_out_of_context.rs"
190required-features = ["time"]