inko: 0.18.1 -> 0.19.1

This commit is contained in:
R. Ryantm
2025-11-20 08:25:33 +01:00
committed by eljamm
parent a7e3137d88
commit 41c3b5181d
2 changed files with 15 additions and 11 deletions
+3 -3
View File
@@ -15,16 +15,16 @@
rustPlatform.buildRustPackage (finalAttrs: {
pname = "inko";
version = "0.18.1";
version = "0.19.1";
src = fetchFromGitHub {
owner = "inko-lang";
repo = "inko";
tag = "v${finalAttrs.version}";
hash = "sha256-jVfAfR02R2RaTtzFSBoLuq/wdPaaI/eochrZaRVdmHY=";
hash = "sha256-ZHVOwYvNRL2ObZt2PvayoqvS64MumN4oXQOgeCWbEUM=";
};
cargoHash = "sha256-IOMhwcZHB5jVYDM65zifxCjVHWl1EBbxNA3WVmarWcs=";
cargoHash = "sha256-BHrbqPMQnhw8pjN8e0/qW1rPe/fMhs2iUbRVPt5ATrg=";
buildInputs = [
libffi
+12 -8
View File
@@ -7,26 +7,30 @@
let
source =
# https://docs.inko-lang.org/manual/v0.19.1/getting-started/hello-concurrency/#channels
writeText "hello.inko" # inko
''
import std.process (sleep)
import std.stdio (STDOUT)
import std.stdio (Stdout)
import std.sync (Channel)
import std.time (Duration)
class async Printer {
fn async print(message: String, channel: Channel[Nil]) {
let _ = STDOUT.new.print(message)
type async Printer {
fn async print(message: String, channel: uni Channel[Nil]) {
let _ = Stdout.new.print(message)
channel.send(nil)
}
}
class async Main {
type async Main {
fn async main {
let channel = Channel.new(size: 2)
let channel = Channel.new
Printer().print('Hello', channel)
Printer().print('world', channel)
Printer().print('Hello', recover channel.clone)
Printer().print('world', recover channel.clone)
sleep(Duration.from_millis(500))
channel.receive
channel.receive