Git Product home page Git Product logo

chatbus's Introduction

GopherCon 2019 Azure Service Bus chat application (chatbus)

You are challenged to fill in the send and receive sides of a chat application using Azure Service Bus. There are two functions to fill in before you are able to chat with your fellow Gophers. You can find both functions within ./cmd/join.go.

func sendMessage(ctx context.Context, topic *servicebus.Topic, name, message string) error {
	ctx, span := tab.StartSpan(ctx, "join.sendMessage")
	defer span.End()

	// TODO: Create a ChatMessage

	// TODO: marshal ChatMessage into bits

	// TODO: send message to topic
	return nil
}

func listenForAMessage(ctx context.Context, subscription *servicebus.Subscription) (*ChatMessage, error) {
	ctx, span := tab.StartSpan(ctx, "join.listenForAMessage")
	defer span.End()

	// TODO: receive one message from the subscription and unmarshal into ChatMessage

	// TODO: return ChatMessage
	return nil, nil
}

In sendMessage you are required to send a message to an Azure Service Bus Topic. A Topic is a target for broadcast messages to be listened to many subscribers.

In listenForMessage you are required to listen to a subscription on a topic to receive messages from the topic.

Documentation

If you are up for the challenge, there is help to be had in https://godoc.org/github.com/Azure/azure-service-bus-go.

Build and run

  • git clone github.com/devigned/chatbus
  • go run .

chatbus's People

Contributors

devigned avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.