-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(oops): add queuing subsystem to the __other__ dst too (#271)
Co-authored-by: Gabriel Guerra <[email protected]>
- Loading branch information
Showing
6 changed files
with
57 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package queuing | ||
|
||
import ( | ||
"github.com/resonatehq/resonate/internal/app/subsystems/aio/queuing/connections/t_conn" | ||
"github.com/resonatehq/resonate/internal/app/subsystems/aio/queuing/metadata" | ||
"github.com/resonatehq/resonate/internal/app/subsystems/aio/queuing/routes/t_route" | ||
) | ||
|
||
// NewDST is a simple helper functions that wraps New and returns a pre-configured QueuingSubsystem. | ||
// This configurations aligns with the DST tests. Search for: 'id = fmt.Sprintf("/gpu/summarize/%s", id)' | ||
// TOOD: make a real DST one that just mocks network calls. | ||
func NewDST() (*QueuingSubsystem, error) { | ||
queuing, err := New("http://localhost:8001", &Config{ | ||
Connections: []*t_conn.ConnectionConfig{ | ||
{ | ||
Kind: t_conn.HTTP, | ||
Name: "summarize", | ||
Metadata: &metadata.Metadata{ | ||
Properties: map[string]interface{}{ | ||
"url": "http://localhost:5001", | ||
}, | ||
}, | ||
}, | ||
}, | ||
Routes: []*t_route.RoutingConfig{ | ||
{ | ||
Kind: t_route.Pattern, | ||
Name: "default", | ||
Target: &t_route.Target{ | ||
Connection: "summarize", | ||
Queue: "analytics", | ||
}, | ||
Metadata: &metadata.Metadata{ | ||
Properties: map[string]interface{}{ | ||
"pattern": "/gpu/summarize/*", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return queuing, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters