Mir client API lacks simple synchronous interface
Bug #1112195 reported by
Daniel van Vugt
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mir |
Fix Released
|
High
|
Daniel van Vugt |
Bug Description
Looking at mir_client_
"Doing simple things should be simple"
Everything is asynchronous. That's useful in uncommon use-cases, but most of the time people just need and want a simple synchronous API:
conn = mir_connect(...);
but instead you currently have to implement a callback function and pass it to mir_connect, just to get your connection handle.
Callbacks should be optional. They over-complicate things for common use-cases. It should always be simple to do simple things.
Related branches
lp://qastaging/~vanvugt/mir/remove-callbacks-mir_connect
- PS Jenkins bot (community): Approve (continuous-integration)
- Thomas Voß (community): Disapprove
- Alan Griffiths: Disapprove
-
Diff: 743 lines (+73/-198)17 files modifiedexamples/demo_client.c (+1/-6)
examples/demo_client_accelerated.cpp (+1/-7)
examples/demo_client_unaccelerated.c (+1/-7)
include/mir_client/mir_client_library.h (+3/-14)
include/mir_client/mir_client_library_lightdm.h (+1/-2)
src/client/mir_client_library.cpp (+13/-7)
src/client/mir_connection.cpp (+8/-8)
src/client/mir_connection.h (+3/-5)
tests/acceptance-tests/test_client_library.cpp (+16/-14)
tests/acceptance-tests/test_focus_management_api.cpp (+2/-10)
tests/acceptance-tests/test_surfaceloop.cpp (+6/-31)
tests/integration-tests/test_display_info.cpp (+1/-7)
tests/integration-tests/test_drm_auth_magic.cpp (+2/-8)
tests/integration-tests/test_error_reporting.cpp (+2/-25)
tests/integration-tests/test_surfaceloop.cpp (+8/-34)
tests/unit-tests/client/test_client_mir_surface.cpp (+1/-5)
tests/unit-tests/client/test_mir_connection.cpp (+4/-8)
lp://qastaging/~vanvugt/mir/simple-connect
- Alan Griffiths: Disapprove
- Robert Carr (community): Abstain
- PS Jenkins bot (community): Approve (continuous-integration)
-
Diff: 319 lines (+149/-19)10 files modifiedexamples/demo_client.c (+2/-7)
include/mir_client/mir_client_library.h (+15/-0)
src/client/mir_client_library.cpp (+12/-1)
src/client/mir_connection.cpp (+3/-2)
src/client/mir_wait_handle.cpp (+6/-4)
src/client/mir_wait_handle.h (+3/-2)
tests/acceptance-tests/test_client_library.cpp (+45/-1)
tests/unit-tests/client/CMakeLists.txt (+1/-0)
tests/unit-tests/client/test_mir_connection.cpp (+24/-2)
tests/unit-tests/client/test_wait.cpp (+38/-0)
lp://qastaging/~vanvugt/mir/optional-callbacks
- Chris Halse Rogers: Approve
- Alan Griffiths: Disapprove
- PS Jenkins bot (community): Approve (continuous-integration)
-
Diff: 999 lines (+236/-200)21 files modifiedexamples/demo_client.c (+1/-6)
examples/demo_client_accelerated.cpp (+1/-7)
examples/demo_client_unaccelerated.c (+1/-7)
examples/eglapp.c (+1/-3)
include/mir_toolkit/mir_client_library.h (+19/-13)
include/mir_toolkit/mir_client_library_lightdm.h (+1/-2)
src/client/mir_client_library.cpp (+20/-7)
src/client/mir_connection.cpp (+8/-8)
src/client/mir_connection.h (+3/-5)
src/client/mir_wait_handle.cpp (+24/-0)
src/client/mir_wait_handle.h (+6/-0)
tests/acceptance-tests/test_client_library.cpp (+50/-14)
tests/acceptance-tests/test_focus_management_api.cpp (+2/-10)
tests/acceptance-tests/test_surfaceloop.cpp (+6/-31)
tests/integration-tests/test_display_info.cpp (+1/-7)
tests/integration-tests/test_drm_auth_magic.cpp (+2/-8)
tests/integration-tests/test_error_reporting.cpp (+2/-25)
tests/integration-tests/test_surfaceloop.cpp (+8/-34)
tests/unit-tests/client/test_client_mir_surface.cpp (+1/-5)
tests/unit-tests/client/test_mir_connection.cpp (+4/-8)
tests/unit-tests/client/test_wait_handle.cpp (+75/-0)
lp://qastaging/~vanvugt/mir/super-simple-connect
- Chris Halse Rogers: Approve
- Robert Ancell: Approve
- PS Jenkins bot (community): Approve (continuous-integration)
-
Diff: 86 lines (+47/-0)3 files modifiedinclude/client/mir_toolkit/mir_client_library.h (+8/-0)
src/client/mir_client_library.cpp (+18/-0)
tests/acceptance-tests/test_client_library.cpp (+21/-0)
lp://qastaging/~vanvugt/mir/sync-api
- Robert Ancell: Approve
- Alan Griffiths: Approve
- PS Jenkins bot (community): Approve (continuous-integration)
-
Diff: 394 lines (+127/-73)6 files modifiedexamples/demo_client_accelerated.cpp (+7/-27)
examples/demo_client_unaccelerated.c (+9/-34)
examples/eglapp.c (+2/-11)
include/client/mir_toolkit/mir_client_library.h (+24/-0)
src/client/mir_client_library.cpp (+28/-1)
tests/acceptance-tests/test_client_library.cpp (+57/-0)
description: | updated |
Changed in mir: | |
assignee: | nobody → Daniel van Vugt (vanvugt) |
Changed in mir: | |
status: | New → Opinion |
information type: | Proprietary → Public |
Changed in mir: | |
status: | Opinion → In Progress |
Changed in mir: | |
milestone: | none → 0.0.3 |
Changed in mir: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
To clarify, I suggest a simple split. Functions that are presently asynchronous should have two versions. For example: connect( )
mir_connect()
mir_async_
Unless someone can think of a way to keep them as one function in an elegant way?