• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

realm / realm-core / 2357

29 May 2024 11:05PM UTC coverage: 90.843% (+0.04%) from 90.801%
2357

push

Evergreen

web-flow
Merge pull request #7609 from realm/tg/session-lifecycle

RCORE-2092 Simplify the SessionWrapper lifecycle a bit

101578 of 179868 branches covered (56.47%)

506 of 544 new or added lines in 14 files covered. (93.01%)

42 existing lines in 13 files now uncovered.

214462 of 236080 relevant lines covered (90.84%)

5704793.94 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

33.33
/src/realm/sync/binding_callback_thread_observer.hpp
1
////////////////////////////////////////////////////////////////////////////
2
//
3
// Copyright 2017 Realm Inc.
4
//
5
// Licensed under the Apache License, Version 2.0 (the "License");
6
// you may not use this file except in compliance with the License.
7
// You may obtain a copy of the License at
8
//
9
// http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing, software
12
// distributed under the License is distributed on an "AS IS" BASIS,
13
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
// See the License for the specific language governing permissions and
15
// limitations under the License.
16
//
17
////////////////////////////////////////////////////////////////////////////
18

19
#ifndef REALM_OS_BINDING_CALLBACK_THREAD_OBSERVER_HPP
20
#define REALM_OS_BINDING_CALLBACK_THREAD_OBSERVER_HPP
21

22
#include <exception>
23

24
namespace realm {
25
// Interface for observing the lifecycle of the worker thread used by
26
// DefaultSocketProvider. This is required to be able to attach/detach the thread
27
// to the JVM to be able to perform JNI calls.
28
struct BindingCallbackThreadObserver {
29
    virtual ~BindingCallbackThreadObserver() = default;
12✔
30

31
    // Called on the thread shortly after it is created. This is guaranteed to
32
    // be called before any other callbacks to the SDK are made.
33
    virtual void did_create_thread() {}
8✔
34
    // Called on the thread shortly before it is destroyed. No further callbacks
35
    // to the SDK on the thread will be made after this is called.
36
    virtual void will_destroy_thread() {}
8✔
37
    // If has_handle_error() returns true, any uncaught exceptions from the
38
    // event loop are passed to this. If this returns true, the thread exits
39
    // cleanly, while if it returns false the exception is rethrown.
40
    virtual bool handle_error(const std::exception&)
41
    {
×
NEW
42
        return false;
×
43
    }
×
44
    virtual bool has_handle_error()
UNCOV
45
    {
×
NEW
46
        return false;
×
47
    }
×
48
};
49

50
} // namespace realm
51

52
#endif // REALM_OS_BINDING_CALLBACK_THREAD_OBSERVER_HPP
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc