Skip to content

Commit

Permalink
Extract yorkieServer and clusterServer from rpc.Server (yorkie-team#200)
Browse files Browse the repository at this point in the history
Co-authored-by: Hackerwins <[email protected]>
  • Loading branch information
dc7303 and hackerwins authored Jun 17, 2021
1 parent 9a0f843 commit 6d5148f
Show file tree
Hide file tree
Showing 4 changed files with 424 additions and 385 deletions.
13 changes: 12 additions & 1 deletion yorkie/rpc/cluster.go → yorkie/rpc/cluster_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,21 @@ import (
"github.com/yorkie-team/yorkie/api/converter"
"github.com/yorkie-team/yorkie/internal/log"
"github.com/yorkie-team/yorkie/pkg/document/time"
"github.com/yorkie-team/yorkie/yorkie/backend"
)

// clusterServer is a normal server that processes the broadcast by the agent.
type clusterServer struct {
backend *backend.Backend
}

// newClusterServer creates a new instance of clusterServer.
func newClusterServer(be *backend.Backend) *clusterServer {
return &clusterServer{backend: be}
}

// BroadcastEvent publishes the given event to the given Topic.
func (s *Server) BroadcastEvent(
func (s *clusterServer) BroadcastEvent(
ctx context.Context,
request *api.BroadcastEventRequest,
) (*api.BroadcastEventResponse, error) {
Expand Down
Loading

0 comments on commit 6d5148f

Please sign in to comment.