Beamable SDK
Public Member Functions | Protected Member Functions | Protected Attributes | Properties | List of all members
Beamable.Api.PlatformSubscribable< ScopedRsp, Data > Class Template Reference

This type defines the subscribability of services. More...

Inheritance diagram for Beamable.Api.PlatformSubscribable< ScopedRsp, Data >:
Inheritance graph
[legend]
Collaboration diagram for Beamable.Api.PlatformSubscribable< ScopedRsp, Data >:
Collaboration graph
[legend]

Public Member Functions

PlatformSubscription< Data > Subscribe (Action< Data > callback)
 Subscribe to the callback to receive fresh data when available. More...
 
virtual PlatformSubscription< Data > Subscribe (string scope, Action< Data > callback)
 Subscribe to the callback to receive fresh data when available. More...
 
Promise< UnitRefresh ()
 Manually refresh the available data. More...
 
Data GetLatest ()
 
Data GetLatest (string scope)
 
async Promise< ScopedRsp > Fetch (string scope="")
 Send a request and get the latest state of the subscription. This method will not trigger existing subscriptions More...
 
Promise< Data > GetCurrent (string scope="")
 Manually fetch the available data. If the server hasn't delivered a new update, this method will not return the absolute latest data unless you pass forceRefresh as true. More...
 
void Notify (Data data)
 Manually notify observing scopes regarding the available data. More...
 
void Notify (string scope, Data data)
 Manually notify observing scopes regarding the available data. More...
 
- Public Member Functions inherited from Beamable.Common.Api.ISupportsGet< Data >
Promise< TData > GetCurrent (string scope="")
 Manually fetch the available data. If the server hasn't delivered a new update, this method will not return the absolute latest data unless you pass forceRefresh as true. More...
 
- Public Member Functions inherited from Beamable.Common.Api.ISupportGetLatest< Data >
TData GetLatest (string scope="")
 Manually read the currently cached data. This will not trigger any network request. More...
 

Protected Member Functions

 PlatformSubscribable (IDependencyProvider provider, string service, BeamableGetApiResource< ScopedRsp > getter=null)
 
virtual void Reset ()
 
virtual Promise OnRefreshScope (string scope)
 
Promise< UnitRefresh (string scope)
 Manually refresh the available data. More...
 
virtual Promise< ScopedRsp > ExecuteRequest (IBeamableRequester requester, string url)
 
virtual string CreateRefreshUrl (string scope)
 
virtual void OnRefresh (ScopedRsp data)
 
virtual Promise OnRefresh (ScopedRsp data, string[] scopes)
 
void ScheduleRefresh (long seconds, string scope)
 
void Unsubscribe (string scope, PlatformSubscription< Data > subscription)
 

Protected Attributes

IBeamableRequester requester
 
IConnectivityService connectivityService
 
INotificationService notificationService
 
CoroutineService coroutineService
 
IUserContext userContext
 
BeamableGetApiResource< ScopedRsp > getter
 
readonly string service
 

Properties

bool UsesHierarchyScopes [getprotected set]
 

Detailed Description

This type defines the subscribability of services.

Related Links

img beamable-logo

Member Function Documentation

◆ Fetch()

async Promise< ScopedRsp > Beamable.Api.PlatformSubscribable< ScopedRsp, Data >.Fetch ( string  scope = "")
inline

Send a request and get the latest state of the subscription. This method will not trigger existing subscriptions

Parameters
scope
Returns

◆ GetCurrent()

Promise< Data > Beamable.Api.PlatformSubscribable< ScopedRsp, Data >.GetCurrent ( string  scope = "")
inline

Manually fetch the available data. If the server hasn't delivered a new update, this method will not return the absolute latest data unless you pass forceRefresh as true.

Parameters
scope
Returns

◆ GetLatest()

Data Beamable.Api.PlatformSubscribable< ScopedRsp, Data >.GetLatest ( )
inline

Returns

◆ Notify() [1/2]

void Beamable.Api.PlatformSubscribable< ScopedRsp, Data >.Notify ( Data  data)
inline

Manually notify observing scopes regarding the available data.

Parameters
data

◆ Notify() [2/2]

void Beamable.Api.PlatformSubscribable< ScopedRsp, Data >.Notify ( string  scope,
Data  data 
)
inline

Manually notify observing scopes regarding the available data.

Parameters
scope
data

◆ Refresh() [1/2]

Promise< Unit > Beamable.Api.PlatformSubscribable< ScopedRsp, Data >.Refresh ( )
inline

Manually refresh the available data.

Returns

◆ Refresh() [2/2]

Promise< Unit > Beamable.Api.PlatformSubscribable< ScopedRsp, Data >.Refresh ( string  scope)
inlineprotected

Manually refresh the available data.

Parameters
scope
Returns

◆ Subscribe() [1/2]

PlatformSubscription< Data > Beamable.Api.PlatformSubscribable< ScopedRsp, Data >.Subscribe ( Action< Data >  callback)
inline

Subscribe to the callback to receive fresh data when available.

Parameters
callback
Returns

◆ Subscribe() [2/2]

virtual PlatformSubscription< Data > Beamable.Api.PlatformSubscribable< ScopedRsp, Data >.Subscribe ( string  scope,
Action< Data >  callback 
)
inlinevirtual

Subscribe to the callback to receive fresh data when available.

Parameters
scope
callback
Returns

The documentation for this class was generated from the following file: