def METHOD_NAME(self, event):
    with portalocker.Lock(self._unsend_events_file, 'r+', timeout=5) as f:
        o = json.loads(f.read())
        events = o.get('unsend_events', None)
        if events is None:
            o['unsend_events'] = []
        o['unsend_events'].append(event)
        f.seek(0)
        f.truncate()
        f.write(json.dumps(o))