Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Remove deprecated Worker and Client methods #109

Merged
merged 1 commit into from
Aug 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 3 additions & 19 deletions temporaltest/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ func (ts *TestServer) NewWorkerWithOptions(taskQueue string, registerFunc func(r
}

// DefaultClient returns the default Temporal client configured for making requests to the server.
// It is configured to use a pre-registered test namespace and will
// be closed on TestServer.Stop.
//
// It is configured to use a pre-registered test namespace and will be closed on TestServer.Stop.
func (ts *TestServer) DefaultClient() client.Client {
if ts.defaultClient == nil {
ts.defaultClient = ts.NewClientWithOptions(ts.defaultClientOptions)
Expand All @@ -81,6 +81,7 @@ func (ts *TestServer) DefaultClient() client.Client {
}

// NewClientWithOptions returns a new Temporal client configured for making requests to the server.
//
// If no namespace option is set it will use a pre-registered test namespace.
// The returned client will be closed on TestServer.Stop.
func (ts *TestServer) NewClientWithOptions(opts client.Options) client.Client {
Expand Down Expand Up @@ -161,20 +162,3 @@ func NewServer(opts ...TestServerOption) *TestServer {

return &ts
}

// Worker registers and starts a Temporal worker on the specified task queue.
//
// Deprecated: Use function NewWorker()
func (ts *TestServer) Worker(taskQueue string, registerFunc func(registry worker.Registry)) worker.Worker {
return ts.NewWorker(taskQueue, registerFunc)
}

// Client returns a Temporal client configured for making requests to the server.
// It is configured to use a pre-registered test namespace and will
// be closed on TestServer.Stop.
//
// Deprecated: Use function DefaultClient()
func (ts *TestServer) Client() client.Client {
return ts.DefaultClient()
}