alec
06/26/2020, 10:38 AMCasey Kulm
06/29/2020, 9:57 PMandev
06/30/2020, 1:47 PMinvalidate()
, but if u simply exit fragment/activity, there is no reason for invalidate()
to be called and then a leak happenalec
06/30/2020, 1:54 PMalec
06/30/2020, 1:54 PMalec
06/30/2020, 1:55 PMandev
06/30/2020, 2:27 PMandev
06/30/2020, 2:36 PMandev
06/30/2020, 2:39 PMalec
06/30/2020, 3:27 PMandev
06/30/2020, 3:54 PMLivePagedListBuilder
andev
06/30/2020, 4:04 PMalec
06/30/2020, 4:40 PMharry.singh
07/01/2020, 5:18 PMwithContext(<http://Dispatchers.IO|Dispatchers.IO>)
before calling them? Room allows to add suspend functions directly in the Dao
classes and I'm wondering if SQLDelight has a similar mechanism?myanmarking
07/02/2020, 12:23 PMPaul Woitaschek
07/03/2020, 1:23 PMfun deSerialize(buffer: BufferedSource): Sequence<Event> {
return generateSequence {
while(true){
if(buffer.request(4)){
break
}
}
val size = buffer.readInt()
while(true){
if(buffer.request(size.toLong())){
break
}
}
val eventBytes = buffer.readByteArray(size.toLong())
protoBuf.load(Event.serializer(), eventBytes)
}
}
Would that be the correct approach to handle this using okio?jw
07/03/2020, 1:26 PMBufferedSource
cannot be used across threads so both loops need to be removed or you need to use synchronization. If you want to transfer data across threads in real-time you should use a Pipe
.jw
07/03/2020, 1:27 PMPipe
, you wouldn't put hot loops on the consumer side, you would just call readInt()
and it would block until 4 bytes are available.Paul Woitaschek
07/03/2020, 1:36 PM@Test
fun pipe() {
val pipe = Pipe(Long.MAX_VALUE)
thread {
val sink = pipe.sink.buffer()
repeat(10){i ->
Thread.sleep(1000)
sink.writeInt(i)
}
}
val source = pipe.source.buffer()
while (true) {
println(source.readInt())
}
}
Paul Woitaschek
07/03/2020, 1:46 PM@Test
fun pipe() {
val pipe = Pipe(Long.MAX_VALUE)
thread {
val sink = pipe.sink
repeat(10) { i ->
Thread.sleep(1000)
val b = Buffer().apply {
println("write $i")
writeInt(i)
}
sink.write(b, b.size)
}
}
while (true) {
val sink = Buffer()
pipe.source.read(sink, 4)
val int = sink.readInt()
println("read $int")
}
}
Paul Woitaschek
07/03/2020, 1:59 PMjw
07/03/2020, 2:09 PMNikky
07/04/2020, 11:37 AMalec
07/04/2020, 11:51 AMNikky
07/04/2020, 11:52 AMDELETE or UPDATE expected, got 'UPDATE'
on this line in a create table statement
"user" integer NOT NULL
CONSTRAINT fk_websessions_user_id
REFERENCES users
ON UPDATE RESTRICT ON DELETE RESTRICT,
alec
07/04/2020, 12:51 PMRESTRICT
saket
07/08/2020, 2:08 PMSiggi Gunnarss
07/08/2020, 3:16 PMbod
07/13/2020, 9:15 AMNativeSqliteDriver
, when my db file doesn't exist, my queries are executed but return nothing. Shouldn't there be an exception instead? If the file does exist I have the same behavior (queries return nothing) - but I suspect the file is not even read.
The exact same code in the JVM target using JdbcSqliteDriver
gives an error when the file is not present / works as expected when it is present.
Ideas?
Also I was wondering if there's a way to enable some logs? Right now I have no idea of what's going on.
Thanks a lot!alec
07/13/2020, 11:56 AM