Skip to content

revisiting client lib #35

@tz70s

Description

@tz70s

Currently, the client library is also horrible and not usable.

To give a brief implementation tips and plan,

  • Ensure the correct semantics of packages and related classes.
  • Prettify
  • Subscribe callback
  • Remain logics modification.

In the experience of eclipse paho, we can add a subscribe callback when the message arrived.
i.e. the callback handler

public interface MessageCallBackHandler {
    void onSuccess(Message message);
    void onFailure(ErrorMessage errorMessage);
}

or we can integrate these into one function for lambda expression

@FunctionalInterface
public interface MessageCallBackHandler {
   // The message ErrorMessage will be the subtype of Message.
    void onComplete(Message message);
}

Further, the client will set up the callback handler and pass it into channel and related processor.

BlockClient blockClient = new BlockClient();
blockClient.setCallBack( new MessageCallBackHandler { /* implementation */ } );

This issue is not in a top priority, but may needed for the experiment in the future.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions