Skip to content

Instantly share code, notes, and snippets.

View ktoso's full-sized avatar
🗻
Life is Study!

Konrad `ktoso` Malawski ktoso

🗻
Life is Study!
View GitHub Profile
[SILGenThunk.cpp:129](emitDistributedThunkForDecl) VAR THUNK IS:
(accessor_decl implicit <anonymous @ 0x1591115a0> interface type="<ActorSystem where ActorSystem : DistributedActorSystem, ActorSystem.SerializationRequirement == any Decodable & Encodable> (Worker<ActorSystem>) -> () async throws -> String" access=internal final captures=(<generic> ) nonisolated distributed_thunk _distributed_get for="distributedVariable"
(parameter "self" interface type="Worker<ActorSystem>" known_to_be_local)
(parameter_list)
(brace_stmt implicit
(if_stmt implicit
(conditions=array
(call_expr implicit type="Bool" nothrow isolation_crossing="none"
(declref_expr implicit type="(AnyObject) -> Bool" decl="Distributed.(file).__isRemoteActor" function_ref=single)
(argument_list implicit
@ktoso
ktoso / isolation-notes.md
Last active September 28, 2023 05:32
isolation-notes.md

Isolation

Notes

that closure will inherits the isolation of the surrounding context by default. Often this is desirable, but if it isn't, there's no way to turn it off2.

Great to acknowlage that! Yes detach is too big of a gun to solve this.


@ktoso
ktoso / gist:4d160232407e4d5835b5ba700c73de37
Last active August 6, 2020 01:42
swift tracing mini notes, sswg call

Swift (Baggage) Context & (Distributed) Tracing

Big Picture / Open Questions

"Context"

Everyone has context.

This is _Baggage_Context, intended specifically for carrying values over:

@ktoso
ktoso / cowed.swift
Created October 17, 2019 23:12 — forked from airspeedswift/cowed.swift
COWed
/// Conform references types for use in the COW wrapper to this protocol
protocol Cowable: class {
/// Make a new unique instance of `copied`
static func makeUnique(_ copied: Self) -> Self
}
/// A wrapper that turns a Cowable reference type into a value-semantic
/// type with access to all of its properties
@dynamicMemberLookup
[info] Benchmark (pool) (recursion) (threads) Mode Cnt Score Error Units
[info] AndThenBenchmark.improved_post fjp 8192 1 thrpt 30 2.297 ± 0.053 ops/ms
[info] AndThenBenchmark.improved_post fix 8192 1 thrpt 30 2.389 ± 0.042 ops/ms
[info] AndThenBenchmark.improved_post fie 8192 1 thrpt 30 2.884 ± 0.038 ops/ms
[info] AndThenBenchmark.improved_pre fjp 8192 1 thrpt 30 4.280 ± 0.068 ops/ms
[info] AndThenBenchmark.improved_pre fix 8192 1 thrpt 30 4.486 ± 0.078 ops/ms
[info] AndThenBenchmark.improved_pre fie 8192 1 thrpt 30 1.227 ± 0.018 ops/ms
[info] AndThenBenchmark.stdlib_post fjp 8192 1 thrpt 30 1.678 ± 0.034 ops/ms
[info] AndThenBenchmark.stdlib_post
// auto-generated by sbt-boilerplate
/*
* Copyright (C) 2015-2018 Lightbend Inc. <https://www.lightbend.com>
*/
package akka.japi.tuple
/**
* Used to create tuples with 3 elements in Java.
*/
object Tuple3 {
@ktoso
ktoso / gist:21fc4f7d168c712530ea624606679a78
Created January 4, 2018 12:47
sink ref with low watermark strategy
[WARN] [01/04/2018 13:44:14.114] [RemoteSystem-akka.test.stream-dispatcher-21] [SinkRefTargetSource$$anon$1(akka://RemoteSystem)] Allocated receiver: Actor[akka://RemoteSystem/user/remoteActor/StreamSupervisor-1/$$a-SinkRefTargetSource-0#2110155622]
[WARN] [01/04/2018 13:44:14.130] [StreamRefsSpec-akka.test.stream-dispatcher-16] [SinkRef$$anon$2(akka://StreamRefsSpec)] Created SinkRef, pointing to remote Sink receiver: Actor[akka.tcp://RemoteSystem@localhost:50507/user/remoteActor/StreamSupervisor-1/$$a-SinkRefTargetSource-0#2110155622], local worker: akka.stream.stage.GraphStageLogic$StageActor@2718ee31
[WARN] [01/04/2018 13:44:14.131] [StreamRefsSpec-akka.test.stream-dispatcher-16] [SinkRef$$anon$2(akka://StreamRefsSpec)] Sending sequenced: SequencedOnNext(0,payload-1) to Actor[akka.tcp://RemoteSystem@localhost:50507/user/remoteActor/StreamSupervisor-1/$$a-SinkRefTargetSource-0#2110155622]
[WARN] [01/04/2018 13:44:14.131] [StreamRefsSpec-akka.test.stream-dispatcher-16] [SinkRef$$anon$2(akka://StreamRefsSpec
@ktoso
ktoso / gist:9610b2e808cd9fece7a8137d72168653
Created January 4, 2018 12:47
sink ref with low watermark strategy
[WARN] [01/04/2018 13:44:14.114] [RemoteSystem-akka.test.stream-dispatcher-21] [SinkRefTargetSource$$anon$1(akka://RemoteSystem)] Allocated receiver: Actor[akka://RemoteSystem/user/remoteActor/StreamSupervisor-1/$$a-SinkRefTargetSource-0#2110155622]
[WARN] [01/04/2018 13:44:14.130] [StreamRefsSpec-akka.test.stream-dispatcher-16] [SinkRef$$anon$2(akka://StreamRefsSpec)] Created SinkRef, pointing to remote Sink receiver: Actor[akka.tcp://RemoteSystem@localhost:50507/user/remoteActor/StreamSupervisor-1/$$a-SinkRefTargetSource-0#2110155622], local worker: akka.stream.stage.GraphStageLogic$StageActor@2718ee31
[WARN] [01/04/2018 13:44:14.131] [StreamRefsSpec-akka.test.stream-dispatcher-16] [SinkRef$$anon$2(akka://StreamRefsSpec)] Sending sequenced: SequencedOnNext(0,payload-1) to Actor[akka.tcp://RemoteSystem@localhost:50507/user/remoteActor/StreamSupervisor-1/$$a-SinkRefTargetSource-0#2110155622]
[WARN] [01/04/2018 13:44:14.131] [StreamRefsSpec-akka.test.stream-dispatcher-16] [SinkRef$$anon$2(akka://StreamRefsSpec
/**
* Returns a Flow.Processor that subscribes to a sequence of Operations and
* produces a sequence of corresponding Submissions. The Operations must be
* members of this OperationGroup. Calling Subscription.onNext with any
* Operation that is not a member of this OperationGroup, that is was not
* created by calling one of the Operation factory methods on this
* OperationGroup, will cause the Subscription to be canceled and call
* Subscriber.onError with IllegalArgumentException. The method
* Subscription.onNext will call submit on each Operation it is passed and
* publish the resulting Submission. Since an Operation can only be submitted