It would be nice if IDE would know it's a conflate...
# announcements
c
It would be nice if IDE would know it's a conflated channel and not put the suspend arrow indicator when calling send() on it... maybe it was better a specific type than an initialization parameter
g
It’s not nice, because send() is still suspend function, even if it invoking very fast
c
is it? but the documentation says it won't suspend and offer returns always true
g
if you know that it’s conflated channel, just
offer()
, if for some reason you want to avoid suspend indicator
☝️ 1
c
true
g
it won’t suspend
it’s just return immediately, but it still suspend function and cannot be called out of suspending lambda
c
ok
m
Let me steal this thread with similar question: Does that mean that
offer
and
send
are competely identical with conflated channel or is
send
still slightly more expensive since it needs to drag whole coroutine machinery with it?
g
Yes, offer is a bit more efficient because doesn’t create suspend point as send
m
so basically we should alwys use offer on conflated channels?
Or is there a reason to use send?
g
I wouldn’t say that “we should”
reason to use send
If you want cancellation/suspend point
or just to make it more future proof, because essentially you must be 100% sure that it’s conflated channel
👍 1