<feed xmlns='http://www.w3.org/2005/Atom'>
<title>sdbusplus/example, branch master</title>
<subtitle>OpenBMC systemd DBUS binding API sources</subtitle>
<id>https://git.raptorcs.com/git/sdbusplus/atom?h=master</id>
<link rel='self' href='https://git.raptorcs.com/git/sdbusplus/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/sdbusplus/'/>
<updated>2019-06-04T22:19:12+00:00</updated>
<entry>
<title>asio: Allow mutable lambdas + small cleanup</title>
<updated>2019-06-04T22:19:12+00:00</updated>
<author>
<name>James Feist</name>
<email>james.feist@linux.intel.com</email>
</author>
<published>2019-06-04T21:11:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/sdbusplus/commit/?id=c14699f63e909ed6d8599e65503ee9c1e3a104d6'/>
<id>urn:sha1:c14699f63e909ed6d8599e65503ee9c1e3a104d6</id>
<content type='text'>
There are many cases in which we want to have a mutable
capture so that the lambda takes over the parameter and
we can modify it after the async callback. By making the
top level lambda mutable, the users callback can be mutable.

Also remove a couple references to experimental and a copy
that I saw when I was fixing this issue.

Tested: Added test and made sure that refish which uses
many async_method_calls still worked fine

Change-Id: Ifb1f9d8b9217187799e2defe429e76a937297ca1
Signed-off-by: James Feist &lt;james.feist@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>Change async_method_call to be no-throw</title>
<updated>2019-05-16T20:23:10+00:00</updated>
<author>
<name>Vernon Mauery</name>
<email>vernon.mauery@linux.intel.com</email>
</author>
<published>2019-05-07T23:53:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/sdbusplus/commit/?id=c077190dfa34f83869685a34fce78d57bfc96f76'/>
<id>urn:sha1:c077190dfa34f83869685a34fce78d57bfc96f76</id>
<content type='text'>
The async_method_call() would throw despite the inferred promise that it
would not, because the handler would be passed an error_code object. But
that would only protect from the dbus method call itself.  When it came
time to unpack the response, the read_into_tuple(...) method call would
throw if the received types did not match the expected types. And
because this throw would happen in a separate boost::asio context, the
throw would always be fatal. Now, any exception during the D-Bus call or
unpacking of parameters will result in an error_code getting passed into
the handler so it can take appropriate action.

This also updates the example to remove try/catch statements around the
async_method_call and yield_method_call examples and shows what happens
if the method calls fail because of different types of errors
(api/function does not exist vs. incorrect unpack types).

Tested-by: run asio-example to see that it works as expected:
    # /tmp/asio-example
    voidBar() -&gt; 42
    fooYield(yield, 41)...
    async_send callback
    error with async_send
    ipmiInterface:execute(61)
    async_method_call callback
    /org/openbmc/control/bmc0
    /org/openbmc/control/flash/bmc
    fooYield(yield, 41)...
    ipmi call returns OK!
    foo(41) -&gt; 42
    async_method_call callback
    async_method_call expected failure: generic:foo(41) -&gt; 42
    yielding call to foo OK! (-&gt; 42)
    22
    async call to Properties.Get serialized via yield OK!
    TestYieldFunction return 42
    yielding call to foo OK! (-&gt; 42)
    yielding call to TestYieldFunction serialized via yield OK!
    fooYield(yield, 41)...
    foo(41) -&gt; 42
    async call to Properties.Get serialized via yield OK!
    yielding call to foo OK! (-&gt; 42)
    TestYieldFunction expected error: generic:22
    TestYieldFunctionNotExits expected error: generic:53
    *** tick ***
    *** tock ***
    *** tick ***
    *** tick ***
    *** tick ***

Change-Id: I53c91484ed496556342b3ed0a58b690872a2d676
Signed-off-by: Vernon Mauery &lt;vernon.mauery@linux.intel.com&gt;

stuff

Change-Id: I48da27be7ba8c63f44c12a8b79fffb8f3e085648
Signed-off-by: Vernon Mauery &lt;vernon.mauery@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>Change yield_method_call to be no-throw</title>
<updated>2019-05-10T15:11:23+00:00</updated>
<author>
<name>Vernon Mauery</name>
<email>vernon.mauery@linux.intel.com</email>
</author>
<published>2019-05-07T23:53:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/sdbusplus/commit/?id=37a5e61732ef93163b6f508eda046ff7b965314a'/>
<id>urn:sha1:37a5e61732ef93163b6f508eda046ff7b965314a</id>
<content type='text'>
The yield_method_call() would throw despite the inferred promise that it
would not, because the caller could attach an error_code to the yield
object. But that would only protect from the dbus method call itself.
When it came time to unpack the response, the read(...) method call
would throw if the received types did not match the expected types. Now,
the method forces you to pass in an error_code and it will always return
the appropriate error instead of throw.

Tested-by: run asio-example to see that it works as expected:
    # /tmp/asio-example
    voidBar() -&gt; 42
    async_send callback
    error with async_send
    async_method_call callback
    /org/openbmc/control/bmc0
    /org/openbmc/control/flash/bmc
    fooYield(yield, 41)...
    ipmiInterface:execute(61)
    ipmi call returns OK!
    fooYield(yield, 41)...
    foo(41) -&gt; 42
    async call to Properties.Get serialized via yield OK!
    foo(41) -&gt; 42
    yielding call to foo OK! (-&gt; 42)
    TestYieldFunction return 42
    yielding call to foo OK! (-&gt; 42)
    yielding call to TestYieldFunction serialized via yield OK!
    async call to Properties.Get serialized via yield OK!
    *** tick ***
    *** tock ***
    *** tick ***
    *** tick ***
    *** tick ***
    *** tick ***
    *** tick ***

Change-Id: Iea43acd432107b4149f8e549310cfce2518cbc1d
Signed-off-by: Vernon Mauery &lt;vernon.mauery@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>std::variant: Remove uses of the variant_ns</title>
<updated>2019-04-05T22:14:52+00:00</updated>
<author>
<name>William A. Kennington III</name>
<email>wak@google.com</email>
</author>
<published>2018-11-26T17:50:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/sdbusplus/commit/?id=4274c117dd2866ac60508f438e7427f99dee6be4'/>
<id>urn:sha1:4274c117dd2866ac60508f438e7427f99dee6be4</id>
<content type='text'>
Now that we are using std::variant we should reference it directly
instead of using our own namespace alias.

Tested:
    Built and ran through unit tests.

Change-Id: Ic3fd62ea74cf808b85ad7b7ffcce8c0a0bfb125d
Signed-off-by: William A. Kennington III &lt;wak@google.com&gt;
</content>
</entry>
<entry>
<title>Move asio interfaces away from deprecated names</title>
<updated>2019-01-12T01:37:38+00:00</updated>
<author>
<name>Ed Tanous</name>
<email>ed.tanous@intel.com</email>
</author>
<published>2019-01-02T22:15:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/sdbusplus/commit/?id=c7d104d2d3f384644b767a4d7db5a2e997eccbc3'/>
<id>urn:sha1:c7d104d2d3f384644b767a4d7db5a2e997eccbc3</id>
<content type='text'>
The intent of this commit is to allow building asio based event loops in
applications with BOOST_ASIO_NO_DEPRECATED flag set.  This change is
largely a sed replace of io_service with io_context.

This will allow us to move to the networking TS at such time that it is
mature.  Details on depreated interfaces are available here for
reference:

https://www.boost.org/doc/libs/1_69_0/doc/html/boost_asio/net_ts.html

Change-Id: Ie3cc699effcf855a649dee5bfce2f6616109429b
Signed-off-by: Ed Tanous &lt;ed.tanous@intel.com&gt;
</content>
</entry>
<entry>
<title>asio: Update variant usage</title>
<updated>2018-12-13T23:53:17+00:00</updated>
<author>
<name>Yong Li</name>
<email>yong.b.li@linux.intel.com</email>
</author>
<published>2018-12-11T09:44:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/sdbusplus/commit/?id=6ee43dc57bce75b36f0145c5e895d3811d5c47d4'/>
<id>urn:sha1:6ee43dc57bce75b36f0145c5e895d3811d5c47d4</id>
<content type='text'>
After the below change in sdbusplus,
the variant usage needs to be switched to std::variant
https://github.com/openbmc/sdbusplus/commit/90778b430290c9ec8c33fb77b03e2552d9dd6905

Tested:
./configure --enable-boost
make

Change-Id: Ic1d156ad379eb56822f75e8046f83fa45f4ad56d
Signed-off-by: Yong Li &lt;yong.b.li@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>sdbusplus: better mirror bus aquisition methods</title>
<updated>2018-12-11T23:24:08+00:00</updated>
<author>
<name>Vernon Mauery</name>
<email>vernon.mauery@linux.intel.com</email>
</author>
<published>2018-11-08T22:55:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/sdbusplus/commit/?id=8ca6025eed193c252149b2908c3d5e37b00b0107'/>
<id>urn:sha1:8ca6025eed193c252149b2908c3d5e37b00b0107</id>
<content type='text'>
This adds new functions:
 * new_default_user() -&gt; return default user bus connection
 * new_default_system() -&gt; returns default system connection

And changes new_default() to return the default type of connection for
the user as per the man page:
https://www.freedesktop.org/software/systemd/man/sd_bus_default.html

Also, update the example and the README to use the default bus calls.

Change-Id: I13cd77dda847c4f6018da38e0019816da07710d1
Signed-off-by: Vernon Mauery &lt;vernon.mauery@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>Add sdbusplus::asio coroutine method handling</title>
<updated>2018-10-24T20:33:17+00:00</updated>
<author>
<name>Vernon Mauery</name>
<email>vernon.mauery@linux.intel.com</email>
</author>
<published>2018-10-02T22:10:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/sdbusplus/commit/?id=076d14af2b3e29e48471ffb7fab632317da0fc21'/>
<id>urn:sha1:076d14af2b3e29e48471ffb7fab632317da0fc21</id>
<content type='text'>
Adding the server-side of the coroutine path allows yielding
asynchronous method handling via coroutines. This means that a method
handler can call a yielding dbus call (or other asio-based asynchronous
call) without blocking the rest of the process.

The call path might look something like this:

service.thing/object/path/interface.my-method()
    - do something
    - yield_method_call(other.service, /other/path,
                 other.interface, other-method)
    &lt;yields to other coroutine&gt;

execute other code in another context

    &lt;returns some time later with dbus call's response&gt;
    - use response from other method
    &lt;- return my-method response

This also changes the asio-example, pulling it apart into a
client/server model so it is more clear about how to use the yielding
async method handling and yielding async method calls.

Change-Id: I23ccf7a9a8dff787be78929959c1f018280a0392
Signed-off-by: Vernon Mauery &lt;vernon.mauery@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>Avoid build failure when sdbus++ tool is disabled</title>
<updated>2018-10-16T21:36:38+00:00</updated>
<author>
<name>Manojkiran Eda</name>
<email>manojkiran.eda@gmail.com</email>
</author>
<published>2018-09-27T07:49:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/sdbusplus/commit/?id=ad7e686b5563a146728aa9477f6e814dc0a3cbd4'/>
<id>urn:sha1:ad7e686b5563a146728aa9477f6e814dc0a3cbd4</id>
<content type='text'>
Few examples provided as a part of the repository are dependent on the
sdbus++ code generation tool, and the compilation will fail trying to
build the examples even in cases where the user disables sdbusapp during
configuration using --disable-sdbuspp option.

- Made a change in example/Makefile.am to build the examples which are
  dependent on sdbus++ tool(which is dependent on few python packages)
  only when the sdbuspp is enabled during configuration.

Resolves openbmc/sdbusplus#19

Change-Id: I1453536fd4c7df35e66f2ccfe7a890cced0d155d
Signed-off-by: Manojkiran Eda &lt;manojkiran.eda@gmail.com&gt;
</content>
</entry>
<entry>
<title>Add coroutine support for sdbusplus::asio method calls</title>
<updated>2018-10-12T19:27:01+00:00</updated>
<author>
<name>Vernon Mauery</name>
<email>vernon.mauery@linux.intel.com</email>
</author>
<published>2018-09-25T19:34:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/sdbusplus/commit/?id=261e72b6fb5f4fbe95b68a5a6e3ee863025b3be3'/>
<id>urn:sha1:261e72b6fb5f4fbe95b68a5a6e3ee863025b3be3</id>
<content type='text'>
Using a coroutine to asynchronously execute method calls gives the best
of both worlds:
1) better readability because the code reads like synchronous code
2) better throughput because it is actually asynchronous

When passed in a boost::asio::yield_context, the sdbusplus::asio dbus
connection members async_send and async_method_call will execute
asynchronously using coroutines.

This also adds an example of how this works in the
example/asio-example.cpp file.

Change-Id: Ifb71b2c757ecbfd16b3be95bdefc45a701ca0d51
Signed-off-by: Vernon Mauery &lt;vernon.mauery@linux.intel.com&gt;
</content>
</entry>
</feed>
