Skip to content

ARROW-4005: [Plasma] [GLib] Add gplasma_client_disconnect()#3163

Closed
shiro615 wants to merge 5 commits intoapache:masterfrom
shiro615:glib-add-disconnect-for-plasma-glib
Closed

ARROW-4005: [Plasma] [GLib] Add gplasma_client_disconnect()#3163
shiro615 wants to merge 5 commits intoapache:masterfrom
shiro615:glib-add-disconnect-for-plasma-glib

Conversation

@shiro615
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Member

@kou kou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!
Can you check my comment?

GError **error)
{
auto plasma_client = gplasma_client_get_raw(client);
auto status = plasma_client->Disconnect();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to keep "disconnected" information.
If users don't call gplasma_client_disconnect() explicitly, we call Disconnect() on fainalize().

if (garrow_error_check(...)) {
  priv->disconnected = true;
  return TRUE;
} else {
  return FALSE;
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ll keep "disconnected” information. If priv->disconnected is true, I will not call Disconnected on finalize().

auto priv = GPLASMA_CLIENT_GET_PRIVATE(client);
auto status = priv->client->Disconnect();
if (garrow_error_check(error, status, "[plasma][client][disconnect]")) {
priv->disconnected = true;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use bool instead of gboolean when we use true.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. I'll use bool.

end

test("#disconnect") do
require_gi(1, 42, 0)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove this by using options?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I've removed require_gi.

Copy link
Copy Markdown
Member

@kou kou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1
I'll merge this when CI is green.

@kou kou closed this in 0005048 Dec 13, 2018
@shiro615 shiro615 deleted the glib-add-disconnect-for-plasma-glib branch December 13, 2018 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants