startTemp method
Implementation
@override
Future<void> startTemp(String? rtKey) async {
// skpark 2024.06.14 현재 firebase bug 로 인해 임시로 막아둠.
//return;
realTimeKey = rtKey;
if (realTimeKey == null || realTimeKey!.isEmpty) {
return;
}
await initialize();
logger.finest('SupabaseRealtime start()');
if (_isListenComplete) {
_isListenComplete = false;
logger.finest('listener restart $lastUpdateTimeStr');
Supabase.instance.client
.channel('public:hycop_delta')
.onPostgresChanges(
event: PostgresChangeEvent.insert,
schema: 'public',
table: 'hycop_delta',
filter: PostgresChangeFilter(
type: PostgresChangeFilterType.eq, column: "realTimeKey", value: realTimeKey),
callback: (PostgresChangePayload payload) {
logger.finest('Insert received: ${payload.toString()}');
processEvent(payload.newRecord);
})
.onPostgresChanges(
event: PostgresChangeEvent.update,
schema: 'public',
table: 'hycop_delta',
filter: PostgresChangeFilter(
type: PostgresChangeFilterType.eq, column: "realTimeKey", value: realTimeKey),
callback: (PostgresChangePayload payload) {
logger.finest('Update received: ${payload.toString()}');
processEvent(payload.newRecord);
})
.subscribe();
}
//});
}