Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/badu/bus
/ functions
Functions
77 in github.com/badu/bus
⨍
Functions
77
◇
Types & classes
47
↓ 27 callers
Function
Sub
Sub subscribes a callback function to listen for a specie of events recovererInfo is declared as variadic, in order not to break the previous version,
main.go:189
↓ 14 callers
Function
Pub
Pub publishes an event which will be dispatched to all listeners
main.go:243
↓ 13 callers
Method
Sub
Sub adds a callback to be called when an event of that type is being published
main.go:45
↓ 11 callers
Method
Pub
Pub allows you to publish an event in that topic
main.go:99
↓ 4 callers
Method
Close
()
test_scenarios/factory-request-reply/events/main.go:51
↓ 3 callers
Method
GetOrderStatus
(ctx context.Context, orderID int)
test_scenarios/request-reply-callback/orders/service.go:29
↓ 3 callers
Method
RegisterOrder
(ctx context.Context, productIDs []int)
test_scenarios/request-reply-callback/orders/service.go:21
↓ 2 callers
Method
AddProductToCart
(ctx context.Context, productID string)
test_scenarios/factory-request-reply/cart/service.go:23
↓ 2 callers
Method
RegisterUser
(ctx context.Context, name, phone string)
test_scenarios/fire-and-forget/users/service.go:21
↓ 2 callers
Method
Reply
()
test_scenarios/factory-request-reply/events/main.go:46
↓ 2 callers
Function
SubCancel
SubCancel can be used if you need to unsubscribe immediately after receiving an event, by making your function return true recovererInfo is declared a
main.go:130
↓ 1 callers
Method
Cancel
Cancel allows callers to manually unsubscribe, in case they don't want to use SubCancel
main.go:121
↓ 1 callers
Method
CreateOrder
(ctx context.Context, productIDs []int)
test_scenarios/request-reply-with-cancellation/orders/service.go:18
↓ 1 callers
Method
EventID
()
main.go:15
↓ 1 callers
Method
GetPricesForProduct
(ctx context.Context, in *ProductIDRequest)
test_scenarios/factory-request-reply/prices/grpc_client.go:8
↓ 1 callers
Method
GetStockForProduct
(ctx context.Context, in *ProductIDRequest)
test_scenarios/factory-request-reply/inventory/grpc_client.go:8
↓ 1 callers
Function
NewAuditService
(sb *strings.Builder)
test_scenarios/fire-and-forget/audit/service.go:15
↓ 1 callers
Function
NewEmailService
(sb *strings.Builder)
test_scenarios/fire-and-forget/notifications/email_service.go:15
↓ 1 callers
Function
NewEventState
(ctx context.Context)
test_scenarios/request-reply-with-cancellation/events/main.go:13
↓ 1 callers
Function
NewInventoryGRPCClientRequestEvent
()
test_scenarios/factory-request-reply/events/main.go:16
↓ 1 callers
Function
NewPricesGRPCClientRequestEvent
()
test_scenarios/factory-request-reply/events/main.go:36
↓ 1 callers
Function
NewRepository
(sb *strings.Builder)
test_scenarios/request-reply-callback/orders/repository.go:26
↓ 1 callers
Function
NewRepository
()
test_scenarios/request-reply-with-cancellation/orders/repository.go:19
↓ 1 callers
Function
NewService
(sb *strings.Builder)
test_scenarios/factory-request-reply/cart/service.go:18
↓ 1 callers
Function
NewService
(sb *strings.Builder)
test_scenarios/request-reply-callback/orders/service.go:16
↓ 1 callers
Function
NewService
(sb *strings.Builder)
test_scenarios/fire-and-forget/users/service.go:16
↓ 1 callers
Function
NewService
()
test_scenarios/request-reply-with-cancellation/orders/service.go:13
↓ 1 callers
Function
NewSmsService
(sb *strings.Builder)
test_scenarios/fire-and-forget/notifications/sms_service.go:15
↓ 1 callers
Function
Range
Range gives access to mapper Range
main.go:262
↓ 1 callers
Method
WaitReply
()
test_scenarios/factory-request-reply/events/main.go:22
↓ 1 callers
Method
WaitReply
()
test_scenarios/factory-request-reply/events/main.go:42
↓ 1 callers
Method
cancel
cancel is private to the topic, but can be accessed via Listener
main.go:62
Function
BenchmarkBroadcast_0008
(b *testing.B)
bench_test.go:18
Function
BenchmarkBroadcast_0008Ptr
(b *testing.B)
bench_test.go:34
Function
BenchmarkBroadcast_0256
(b *testing.B)
bench_test.go:50
Function
BenchmarkBroadcast_0256Ptr
(b *testing.B)
bench_test.go:66
Function
BenchmarkBroadcast_1k
(b *testing.B)
bench_test.go:82
Function
BenchmarkBroadcast_1kPtr
(b *testing.B)
bench_test.go:98
Function
BenchmarkBroadcast_2k
(b *testing.B)
bench_test.go:114
Function
BenchmarkBroadcast_2kPtr
(b *testing.B)
bench_test.go:130
Method
Cancel
Cancel forgets the indicated callback
main.go:89
Method
Close
()
test_scenarios/factory-request-reply/main_test.go:27
Method
Close
()
test_scenarios/request-reply-with-cancellation/events/main.go:20
Method
GetPricesForProduct
(ctx context.Context, in *prices.ProductIDRequest)
test_scenarios/factory-request-reply/main_test.go:20
Method
GetPricesForProduct
(ctx context.Context, productID string)
test_scenarios/factory-request-reply/prices/service.go:16
Method
GetStockForProduct
(ctx context.Context, in *inventory.ProductIDRequest)
test_scenarios/factory-request-reply/main_test.go:41
Method
GetStockForProduct
(ctx context.Context, productID string)
test_scenarios/factory-request-reply/inventory/service.go:16
Function
NewRequestEvent
(payload T)
test_scenarios/request-reply-callback/events/main.go:9
Function
NewService
()
test_scenarios/factory-request-reply/prices/service.go:10
Function
NewService
()
test_scenarios/factory-request-reply/inventory/service.go:10
Function
NewTopic
NewTopic creates a new topic for a specie of events
main.go:32
Method
NumSubs
NumSubs in case you need to perform tests and check the number of subscribers of this particular topic
main.go:81
Method
OnCreateOrder
(event events.CreateOrderEvent)
test_scenarios/request-reply-with-cancellation/orders/repository.go:25
Function
OnDummyEvent
(event *events.DummyEvent)
test_scenarios/fire-and-forget/main_test.go:17
Function
OnInventoryGRPCClientStubRequest
(e *events.InventoryGRPCClientRequestEvent)
test_scenarios/factory-request-reply/main_test.go:45
Function
OnPricesGRPCClientStubRequest
(e *events.PricesGRPCClientRequestEvent)
test_scenarios/factory-request-reply/main_test.go:31
Method
OnSMSRequestEvent
OnSMSRequestEvent is a pub-unsub type, we have to return 'false' to continue listening for this kind of events
test_scenarios/fire-and-forget/audit/service.go:29
Method
OnSMSSendRequest
(event events.SMSRequestEvent)
test_scenarios/fire-and-forget/notifications/sms_service.go:21
Method
OnSMSSentEvent
OnSMSSentEvent is a pub-unsub type where we give up on listening after receiving first message
test_scenarios/fire-and-forget/audit/service.go:34
Method
OnSomeOtherEvent
(event SomeOtherEvent)
main_test.go:179
Method
OnUserRegisteredEvent
(e events.UserRegisteredEvent)
test_scenarios/fire-and-forget/notifications/email_service.go:21
Method
OnUserRegisteredEvent
OnUserRegisteredEvent is classic event handler
test_scenarios/fire-and-forget/audit/service.go:24
Method
Reply
()
test_scenarios/factory-request-reply/events/main.go:26
Function
Reset
Reset allows usage in tests that shares the bus
main.go:267
Function
TestBus
(t *testing.T)
main_test.go:84
Function
TestGRPCClientStub
(t *testing.T)
test_scenarios/factory-request-reply/main_test.go:53
Function
TestRace
TestRace with `go test -run TestRace -race -v`
main_test.go:185
Function
TestRange
(t *testing.T)
main_test.go:126
Function
TestRequestReplyCallback
(t *testing.T)
test_scenarios/request-reply-callback/main_test.go:11
Function
TestRequestReplyWithCancellation
(t *testing.T)
test_scenarios/request-reply-with-cancellation/main_test.go:11
Function
TestReusePayloadPointer
(t *testing.T)
main_test.go:52
Function
TestSubTopicWhilePub
(t *testing.T)
main_test.go:11
Function
TestUserRegistration
(t *testing.T)
test_scenarios/fire-and-forget/main_test.go:21
Method
Topic
Topic gives access to the underlying topic
main.go:94
Function
getKey
()
main.go:271
Method
onCreateOrder
(event *events.RequestEvent[Order])
test_scenarios/request-reply-callback/orders/repository.go:33
Method
onGetOrderStatus
(event *events.RequestEvent[OrderStatus])
test_scenarios/request-reply-callback/orders/repository.go:45