Skip to content

Commit ca34e62

Browse files
committed
New syntax for async
1 parent 727f782 commit ca34e62

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

libraries/common/io/network.effekt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,45 +53,45 @@ namespace internal {
5353
declare void @c_tcp_shutdown(%Int, %Stack)
5454
"""
5555

56-
extern async def connect(host: String, port: Int): Int =
56+
extern def connect(host: String, port: Int) at async: Int =
5757
llvm """
5858
call void @c_tcp_connect(%Pos ${host}, %Int ${port}, %Stack %stack)
5959
ret void
6060
"""
6161

6262
/// The buffer must be kept alive by using it after the call
63-
extern async def read(handle: Int, buffer: ByteArray, offset: Int, size: Int): Int =
63+
extern def read(handle: Int, buffer: ByteArray, offset: Int, size: Int) at async: Int =
6464
llvm """
6565
call void @c_tcp_read(%Int ${handle}, %Pos ${buffer}, %Int ${offset}, %Int ${size}, %Stack %stack)
6666
ret void
6767
"""
6868

6969
/// The buffer must be kept alive by using it after the call
70-
extern async def write(handle: Int, buffer: ByteArray, offset: Int, size: Int): Int =
70+
extern def write(handle: Int, buffer: ByteArray, offset: Int, size: Int) at async: Int =
7171
llvm """
7272
call void @c_tcp_write(%Int ${handle}, %Pos ${buffer}, %Int ${offset}, %Int ${size}, %Stack %stack)
7373
ret void
7474
"""
7575

76-
extern async def close(handle: Int): Unit =
76+
extern def close(handle: Int) at async: Unit =
7777
llvm """
7878
call void @c_tcp_close(%Int ${handle}, %Stack %stack)
7979
ret void
8080
"""
8181

82-
extern io def bind(host: String, port: Int): Int =
82+
extern def bind(host: String, port: Int) at io: Int =
8383
llvm """
8484
%result = call %Int @c_tcp_bind(%Pos ${host}, %Int ${port})
8585
ret %Int %result
8686
"""
8787

88-
extern async def listen(listener: Int, handler: Int => Unit at {io, async, global}): Int =
88+
extern def listen(listener: Int, handler: Int => Unit at {io, async, global}) at async: Int =
8989
llvm """
9090
call void @c_tcp_listen(%Int ${listener}, %Pos ${handler}, %Stack %stack)
9191
ret void
9292
"""
9393

94-
extern async def shutdown(handle: Int): Unit =
94+
extern def shutdown(handle: Int) at async: Unit =
9595
llvm """
9696
call void @c_tcp_shutdown(%Int ${handle}, %Stack %stack)
9797
ret void

0 commit comments

Comments
 (0)