Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zhangyaoxing/socketevent.net
.NET SDK for my project SocketEvent
https://github.com/zhangyaoxing/socketevent.net
Last synced: about 1 month ago
JSON representation
.NET SDK for my project SocketEvent
- Host: GitHub
- URL: https://github.com/zhangyaoxing/socketevent.net
- Owner: zhangyaoxing
- License: mit
- Created: 2014-04-14T01:49:48.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-05-12T03:18:56.000Z (over 10 years ago)
- Last Synced: 2024-10-02T13:21:06.968Z (3 months ago)
- Language: C#
- Size: 638 KB
- Stars: 1
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
SocketEvent.NET
===============
.NET SDK for my project SocketEventHow to use
===============
- Connect to a server```c#
var client = new SocketEventClient(id, url);
```id: is a string identifier to indicate who the client is.
url: SocketEvent server address.- Subscribe
```c#
SocketEventClient.Subscribe(
"EventName",
new Func(
(request) =>
{
// what do you want to do when event triggered.
return RequestResult.Success;
}),
(response) =>
{
// event subscription succeeded.
});
```- Enqueue
Trigger an event
```c#
using (var client = new SocketEventClient(id, url))
{
client.Enqueue(
"EventName",
1, // try time(s)
60, // timeout
new
{
// dynamic object which you can use to pass some parameters.
},
(response) =>
{
// enqueue succeeded.
});result = ResponseFactory.CreateInstance(
ResponseStatus.Success,
null,
true);
}
```